Update for language changes

This commit is contained in:
Patrick Walton 2012-12-13 22:34:55 -08:00
parent 8fd5bd516f
commit b6ae82d05d
4 changed files with 10 additions and 11 deletions

@ -1 +1 @@
Subproject commit ab8f9db13f401eeeff5a08e2955bc6964a7c06e0
Subproject commit b195738006d4b2c147ad10601cd2436f04888574

View file

@ -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);
}

View file

@ -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);

View file

@ -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"