mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
Update for language changes
This commit is contained in:
parent
8fd5bd516f
commit
b6ae82d05d
4 changed files with 10 additions and 11 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit ab8f9db13f401eeeff5a08e2955bc6964a7c06e0
|
Subproject commit b195738006d4b2c147ad10601cd2436f04888574
|
|
@ -108,7 +108,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut JSVa
|
||||||
let bundle = unwrap(obj);
|
let bundle = unwrap(obj);
|
||||||
do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| {
|
do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| {
|
||||||
match nd.kind {
|
match nd.kind {
|
||||||
~Element(ed) => {
|
~Element(ref ed) => {
|
||||||
match ed.kind {
|
match ed.kind {
|
||||||
~HTMLImageElement(*) => {
|
~HTMLImageElement(*) => {
|
||||||
let arg = ptr::offset(JS_ARGV(cx, cast::reinterpret_cast(&vp)), 0);
|
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);
|
let bundle = unwrap(obj);
|
||||||
do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| {
|
do (*bundle).payload.scope.write(&(*bundle).payload.node) |nd| {
|
||||||
match nd.kind {
|
match nd.kind {
|
||||||
~Element(ed) => {
|
~Element(ref ed) => {
|
||||||
let s = str(copy ed.tag_name);
|
let s = str(copy ed.tag_name);
|
||||||
*vp = domstring_to_jsval(cx, &s);
|
*vp = domstring_to_jsval(cx, &s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
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| {
|
do scope.read(&cow::wrap(cast::transmute(script))) |node_contents| {
|
||||||
match *node_contents.kind {
|
match *node_contents.kind {
|
||||||
Element(element) if element.tag_name == ~"script" => {
|
Element(ref element) if element.tag_name == ~"script" => {
|
||||||
match element.get_attr(~"src") {
|
match element.get_attr(~"src") {
|
||||||
Some(move src) => {
|
Some(move src) => {
|
||||||
debug!("found script: %s", src);
|
debug!("found script: %s", src);
|
||||||
|
|
|
@ -420,8 +420,8 @@ impl LayoutTreeBuilder {
|
||||||
fn make_image_box(layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox {
|
fn make_image_box(layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox {
|
||||||
do node.read |n| {
|
do node.read |n| {
|
||||||
match n.kind {
|
match n.kind {
|
||||||
~Element(ed) => match ed.kind {
|
~Element(ref ed) => match ed.kind {
|
||||||
~HTMLImageElement(d) => {
|
~HTMLImageElement(ref d) => {
|
||||||
// TODO: this could be written as a pattern guard, but it triggers
|
// TODO: this could be written as a pattern guard, but it triggers
|
||||||
// an ICE (mozilla/rust issue #3601)
|
// an ICE (mozilla/rust issue #3601)
|
||||||
if d.image.is_some() {
|
if d.image.is_some() {
|
||||||
|
@ -445,7 +445,7 @@ impl LayoutTreeBuilder {
|
||||||
fn make_text_box(_layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox {
|
fn make_text_box(_layout_ctx: &LayoutContext, node: Node, ctx: @FlowContext) -> @RenderBox {
|
||||||
do node.read |n| {
|
do node.read |n| {
|
||||||
match n.kind {
|
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?"
|
_ => fail ~"WAT error: why couldn't we make a text box?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,10 +456,9 @@ impl LayoutTreeBuilder {
|
||||||
match n.kind {
|
match n.kind {
|
||||||
~Doctype(*) | ~Comment(*) => fail ~"Hey, doctypes and comments shouldn't get here! They are display:none!",
|
~Doctype(*) | ~Comment(*) => fail ~"Hey, doctypes and comments shouldn't get here! They are display:none!",
|
||||||
~Text(*) => RenderBox_Text,
|
~Text(*) => RenderBox_Text,
|
||||||
~Element(element) => {
|
~Element(ref element) => {
|
||||||
// FIXME: Bad copy
|
match (&element.kind, display) {
|
||||||
match (copy element.kind, display) {
|
(&~HTMLImageElement(d), _) if d.image.is_some() => RenderBox_Image,
|
||||||
(~HTMLImageElement(d), _) if d.image.is_some() => RenderBox_Image,
|
|
||||||
// (_, Specified(_)) => GenericBox,
|
// (_, Specified(_)) => GenericBox,
|
||||||
(_, _) => RenderBox_Generic // TODO: replace this with the commented lines
|
(_, _) => RenderBox_Generic // TODO: replace this with the commented lines
|
||||||
// (_, _) => fail ~"Can't create box for Node with non-specified 'display' type"
|
// (_, _) => fail ~"Can't create box for Node with non-specified 'display' type"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue