This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use azure::azure_hl::DrawTarget; | |
use gfx::render_task::{draw_solid_color, draw_image, draw_text}; | |
use gfx::geometry::*; | |
use geom::rect::Rect; | |
use image::base::Image; | |
use servo_text::text_run::TextRun; | |
use std::arc::ARC; | |
use dvec::DVec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn build_element_kind(tag_name: &str) -> ~ElementKind { | |
match tag_name { | |
~"div" => ~HTMLDivElement, | |
// what the heck? | |
~"img" => ~HTMLImageElement({ mut size: Size2D(au::from_px(100), au::from_px(100)) }), | |
~"script" => ~HTMLScriptElement, | |
~"head" => ~HTMLHeadElement, | |
_ => ~UnknownElement | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) run /Users/burg/repos/servo/src/rust-core-foundation/core_foundation.rc -o librustcorefoundation.dummy | |
Starting program: /usr/local/bin/rustc /Users/burg/repos/servo/src/rust-core-foundation/core_foundation.rc -o librustcorefoundation.dummy | |
Reading symbols for shared libraries .....+................................................................. done | |
Assertion failed: (S->getType()->isPointerTy() && "Invalid cast"), function CreatePointerCast, file /Users/burg/repos/rust/src/llvm/lib/VMCore/Instructions.cpp, line 2383. | |
Program received signal SIGABRT, Aborted. | |
[Switching to process 80740 thread 0x1d03] | |
0x00007fff8e233ce2 in __pthread_kill () | |
(gdb) bt | |
#0 0x00007fff8e233ce2 in __pthread_kill () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct HTMLImageData { | |
mut image: Option<~str> | |
} | |
struct ElementData { | |
kind: ~ElementKind | |
} | |
enum ElementKind { | |
HTMLImageElement(HTMLImageData) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/burg/repos/servo/src/servo/layout/box.rs:101:14: 101:18 error: illegal borrow: borrowed value does not live long enough | |
/Users/burg/repos/servo/src/servo/layout/box.rs:101 match self { | |
^~~~ | |
/Users/burg/repos/servo/src/servo/layout/box.rs:100:36: 106:5 note: borrowed pointer must be valid for the lifetime &a as defined on the block at 100:36... | |
/Users/burg/repos/servo/src/servo/layout/box.rs:100 pure fn d() -> &a/RenderBoxData { | |
/Users/burg/repos/servo/src/servo/layout/box.rs:101 match self { | |
/Users/burg/repos/servo/src/servo/layout/box.rs:102 GenericBox(ref d) => d, | |
/Users/burg/repos/servo/src/servo/layout/box.rs:103 ImageBox(ref d, _) => d, | |
/Users/burg/repos/servo/src/servo/layout/box.rs:104 TextBox(ref d, _) => d | |
/Users/burg/repos/servo/src/servo/layout/box.rs:105 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait BinarySearchMethods<T: Ord Eq> { | |
pure fn binary_search(&self, &T) -> Option<&self/T>; | |
pure fn binary_search_index(&self, &T) -> Option<uint>; | |
} | |
impl<T: Ord Eq> &[T]: BinarySearchMethods<T> { | |
pure fn binary_search(&self, key: &T) -> Option<&self/T> { | |
match self.binary_search_index(key) { | |
None => None, | |
Some(i) => Some(&self[i]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use core::dvec::DVec; | |
fn main() { | |
let v : DVec<int> = DVec(); | |
v.reserve(1); | |
v.set_elt(0, 12345); | |
debug!("v=%?", v); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inside of scanner.scan_for_runs(...). | |
// box count will be 35. | |
debug!("swapping out boxes."); | |
// swap out old and new box list of flow | |
self.flow.inline().boxes.set(dvec::unwrap(temp_boxes)); | |
debug!("new inline flow boxes:"); | |
do self.flow.inline().boxes.each |box| { | |
debug!("%s", box.debug_str()); true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use core::vec; | |
// A generic tree datatype. | |
mod tree { | |
pub type Tree<T> = { | |
mut parent: Option<T>, | |
mut first_child: Option<T>, | |
mut last_child: Option<T>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BackendDispatcher and SupplementalDispatcher | |
class InspectorSupplementalBackendDispatcher; | |
// Map of dispatchers, dispatch to the appropriate one. | |
class InspectorBackendDispatcher { | |
public: | |
InspectorBackendDispatcher() { } | |
void registerDispatcherForDomain(String domain, InspectorSupplementalBackendDispatcher* dispatcher); |
OlderNewer