diff options
Diffstat (limited to 'src')
m--------- | src/rust-http-client | 0 | ||||
-rw-r--r-- | src/servo/dom/bindings/element.rs | 4 | ||||
-rw-r--r-- | src/servo/html/hubbub_html_parser.rs | 2 | ||||
-rw-r--r-- | src/servo/layout/box_builder.rs | 13 |
4 files changed, 9 insertions, 10 deletions
diff --git a/src/rust-http-client b/src/rust-http-client -Subproject ab8f9db13f401eeeff5a08e2955bc6964a7c06e +Subproject b195738006d4b2c147ad10601cd2436f0488857 diff --git a/src/servo/dom/bindings/element.rs b/src/servo/dom/bindings/element.rs index 0de186942fe..880d95a55a5 100644 --- a/src/servo/dom/bindings/element.rs +++ b/src/servo/dom/bindings/element.rs @@ -108,7 +108,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa let bundle = unwrap(obj); do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| { match nd.kind { - ~Element(ed) => { + ~Element(ref ed) => { match ed.kind { ~HTMLImageElement(*) => { let arg = ptr::offset(JS_ARGV(cx, cast::reinterpret_cast(&vp)), 0); @@ -135,7 +135,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut JSVal) let bundle = unwrap(obj); do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| { match nd.kind { - ~Element(ed) => { + ~Element(ref ed) => { let s = str(copy ed.tag_name); *vp = domstring_to_jsval(cx, &s); } diff --git a/src/servo/html/hubbub_html_parser.rs b/src/servo/html/hubbub_html_parser.rs index f1c7df377f4..a3f83b89816 100644 --- a/src/servo/html/hubbub_html_parser.rs +++ b/src/servo/html/hubbub_html_parser.rs @@ -340,7 +340,7 @@ pub fn parse_html(scope: NodeScope, fn complete_script(scope: &NodeScope, script: hubbub::NodeDataPtr, url: &Url, js_chan: &comm::Chan<JSMessage>) unsafe { do scope.read(&cow::wrap(cast::transmute(script))) |node_contents| { match *node_contents.kind { - Element(element) if element.tag_name == ~"script" => { + Element(ref element) if element.tag_name == ~"script" => { match element.get_attr(~"src") { Some(move src) => { debug!("found script: %s", src); diff --git a/src/servo/layout/box_builder.rs b/src/servo/layout/box_builder.rs index 7733cfb8a62..02dc1015286 100644 --- a/src/servo/layout/box_builder.rs +++ b/src/servo/layout/box_builder.rs @@ -420,8 +420,8 @@ impl LayoutTreeBuilder { fn make_image_box(layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox { do node.read |n| { match n.kind { - ~Element(ed) => match ed.kind { - ~HTMLImageElement(d) => { + ~Element(ref ed) => match ed.kind { + ~HTMLImageElement(ref d) => { // TODO: this could be written as a pattern guard, but it triggers // an ICE (mozilla/rust issue #3601) if d.image.is_some() { @@ -445,7 +445,7 @@ impl LayoutTreeBuilder { fn make_text_box(_layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox { do node.read |n| { match n.kind { - ~Text(string) => @UnscannedTextBox(RenderBoxData(node, ctx, self.next_box_id()), copy string), + ~Text(ref string) => @UnscannedTextBox(RenderBoxData(node, ctx, self.next_box_id()), copy *string), _ => fail ~"WAT error: why couldn't we make a text box?" } } @@ -456,10 +456,9 @@ impl LayoutTreeBuilder { match n.kind { ~Doctype(*) | ~Comment(*) => fail ~"Hey, doctypes and comments shouldn't get here! They are display:none!", ~Text(*) => RenderBox_Text, - ~Element(element) => { - // FIXME: Bad copy - match (copy element.kind, display) { - (~HTMLImageElement(d), _) if d.image.is_some() => RenderBox_Image, + ~Element(ref element) => { + match (&element.kind, display) { + (&~HTMLImageElement(d), _) if d.image.is_some() => RenderBox_Image, // (_, Specified(_)) => GenericBox, (_, _) => RenderBox_Generic // TODO: replace this with the commented lines // (_, _) => fail ~"Can't create box for Node with non-specified 'display' type" |