aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-12-14 18:26:28 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-12-14 18:26:28 -0800
commit157227e8c24c45e93ad65571d5df8b52e2c19a85 (patch)
treec1c87ef4040b62b7bf989e6d2110746a7d293d93 /src
parentb6ae82d05d74c89acb19b4615f4575c60c1cb815 (diff)
downloadservo-157227e8c24c45e93ad65571d5df8b52e2c19a85.tar.gz
servo-157227e8c24c45e93ad65571d5df8b52e2c19a85.zip
Update for language changes; stop crashing
Diffstat (limited to 'src')
-rw-r--r--src/servo-gfx/display_list.rs2
-rw-r--r--src/servo-gfx/font.rs2
-rw-r--r--src/servo-gfx/font_context.rs10
-rw-r--r--src/servo-gfx/resource/image_cache_task.rs11
-rw-r--r--src/servo/dom/bindings/utils.rs4
-rw-r--r--src/servo/html/hubbub_html_parser.rs4
-rw-r--r--src/servo/layout/box.rs14
-rw-r--r--src/servo/layout/box_builder.rs2
-rw-r--r--src/servo/layout/inline.rs6
-rw-r--r--src/servo/layout/text.rs2
-rwxr-xr-xsrc/servo/servo.rc4
11 files changed, 36 insertions, 25 deletions
diff --git a/src/servo-gfx/display_list.rs b/src/servo-gfx/display_list.rs
index c8f79064a95..73bc90a0343 100644
--- a/src/servo-gfx/display_list.rs
+++ b/src/servo-gfx/display_list.rs
@@ -45,7 +45,7 @@ impl DisplayItem {
fn draw_into_context(&self, ctx: &RenderContext) {
match self {
&SolidColor(_, color) => ctx.draw_solid_color(&self.d().bounds, color),
- &Text(_, run, ref range, color) => {
+ &Text(_, ref run, ref range, color) => {
let new_run = @run.deserialize(ctx.font_ctx);
let font = new_run.font;
let origin = self.d().bounds.origin;
diff --git a/src/servo-gfx/font.rs b/src/servo-gfx/font.rs
index d52940f11d1..25164c0c421 100644
--- a/src/servo-gfx/font.rs
+++ b/src/servo-gfx/font.rs
@@ -199,7 +199,7 @@ pub enum FontSelector {
pub impl FontSelector : cmp::Eq {
pure fn eq(&self, other: &FontSelector) -> bool {
match (self, other) {
- (&SelectorPlatformIdentifier(a), &SelectorPlatformIdentifier(b)) => a == b,
+ (&SelectorPlatformIdentifier(ref a), &SelectorPlatformIdentifier(ref b)) => a == b,
(&SelectorStubDummy, &SelectorStubDummy) => true,
_ => false
}
diff --git a/src/servo-gfx/font_context.rs b/src/servo-gfx/font_context.rs
index d0f400386db..49d0b2b2d55 100644
--- a/src/servo-gfx/font_context.rs
+++ b/src/servo-gfx/font_context.rs
@@ -175,10 +175,14 @@ pub impl FontContext {
Font::new_from_buffer(&self, test_font_bin(), &desc.style, self.backend)
},
// TODO(Issue #174): implement by-platform-name font selectors.
- &SelectorPlatformIdentifier(identifier) => {
- let result_handle = self.handle.create_font_from_identifier(copy identifier, copy desc.style);
+ &SelectorPlatformIdentifier(ref identifier) => {
+ let result_handle = self.handle.create_font_from_identifier(copy *identifier,
+ copy desc.style);
result::chain(move result_handle, |handle| {
- Ok(Font::new_from_adopted_handle(&self, move handle, &desc.style, self.backend))
+ Ok(Font::new_from_adopted_handle(&self,
+ move handle,
+ &desc.style,
+ self.backend))
})
}
};
diff --git a/src/servo-gfx/resource/image_cache_task.rs b/src/servo-gfx/resource/image_cache_task.rs
index 100c1800da0..7de5074240e 100644
--- a/src/servo-gfx/resource/image_cache_task.rs
+++ b/src/servo-gfx/resource/image_cache_task.rs
@@ -50,7 +50,7 @@ pub enum ImageResponseMsg {
impl ImageResponseMsg {
pure fn clone() -> ImageResponseMsg {
match &self {
- &ImageReady(img) => ImageReady(unsafe { clone_arc(&img) }),
+ &ImageReady(ref img) => ImageReady(unsafe { clone_arc(img) }),
&ImageNotReady => ImageNotReady,
&ImageFailed => ImageFailed
}
@@ -376,10 +376,15 @@ impl ImageCache {
priv fn purge_waiters(url: Url, f: fn() -> ImageResponseMsg) {
match self.wait_map.find(copy url) {
- Some(@waiters) => {
- for waiters.each |response| {
+ Some(@ref mut waiters) => {
+ let mut new_waiters = ~[];
+ new_waiters <-> *waiters;
+
+ for new_waiters.each |response| {
response.send(f());
}
+
+ *waiters <-> new_waiters;
self.wait_map.remove(move url);
}
None => ()
diff --git a/src/servo/dom/bindings/utils.rs b/src/servo/dom/bindings/utils.rs
index 3b3a79a17f0..35c51264402 100644
--- a/src/servo/dom/bindings/utils.rs
+++ b/src/servo/dom/bindings/utils.rs
@@ -60,8 +60,8 @@ pub unsafe fn domstring_to_jsval(cx: *JSContext, string: &DOMString) -> JSVal {
&null_string => {
JSVAL_NULL
}
- &str(s) => {
- str::as_buf(s, |buf, len| {
+ &str(ref s) => {
+ str::as_buf(*s, |buf, len| {
let cbuf = cast::reinterpret_cast(&buf);
RUST_STRING_TO_JSVAL(JS_NewStringCopyN(cx, cbuf, len as libc::size_t))
})
diff --git a/src/servo/html/hubbub_html_parser.rs b/src/servo/html/hubbub_html_parser.rs
index a3f83b89816..f77abe9058f 100644
--- a/src/servo/html/hubbub_html_parser.rs
+++ b/src/servo/html/hubbub_html_parser.rs
@@ -222,11 +222,11 @@ pub fn parse_html(scope: NodeScope,
// move all ~strs at once (blocked on Rust #3845, #3846, #3847)
let public_id = match &doctype.public_id {
&None => None,
- &Some(id) => Some(copy id)
+ &Some(ref id) => Some(copy *id)
};
let system_id = match &doctype.system_id {
&None => None,
- &Some(id) => Some(copy id)
+ &Some(ref id) => Some(copy *id)
};
let data = DoctypeData(copy doctype.name, move public_id, move system_id,
copy doctype.force_quirks);
diff --git a/src/servo/layout/box.rs b/src/servo/layout/box.rs
index 8e72629e77d..af8856465f2 100644
--- a/src/servo/layout/box.rs
+++ b/src/servo/layout/box.rs
@@ -141,7 +141,7 @@ impl RenderBox {
pure fn is_whitespace_only() -> bool {
match &self {
- &UnscannedTextBox(_, raw_text) => raw_text.is_whitespace(),
+ &UnscannedTextBox(_, ref raw_text) => raw_text.is_whitespace(),
_ => false
}
}
@@ -153,7 +153,7 @@ impl RenderBox {
(@UnscannedTextBox(*), @UnscannedTextBox(*)) => {
self.font_style() == other.font_style()
},
- (@TextBox(_,d1), @TextBox(_,d2)) => core::managed::ptr_eq(d1.run, d2.run),
+ (@TextBox(_, ref d1), @TextBox(_, ref d2)) => core::managed::ptr_eq(d1.run, d2.run),
(_, _) => false
}
}
@@ -244,7 +244,7 @@ impl RenderBox {
&GenericBox(*) => Au(0),
// TODO: consult CSS 'width', margin, border.
// TODO: If image isn't available, consult 'width'.
- &ImageBox(_,i) => Au::from_px(i.get_size().get_default(Size2D(0,0)).width),
+ &ImageBox(_, ref i) => Au::from_px(i.get_size().get_default(Size2D(0,0)).width),
&TextBox(_,d) => d.run.min_width_for_range(&const d.range),
&UnscannedTextBox(*) => fail ~"Shouldn't see unscanned boxes here."
}
@@ -258,7 +258,7 @@ impl RenderBox {
// FlowContext will combine the width of this element and
// that of its children to arrive at the context width.
&GenericBox(*) => Au(0),
- &ImageBox(_,i) => Au::from_px(i.get_size().get_default(Size2D(0,0)).width),
+ &ImageBox(_, ref i) => Au::from_px(i.get_size().get_default(Size2D(0,0)).width),
// a text box cannot span lines, so assume that this is an unsplit text box.
@@ -304,7 +304,7 @@ impl RenderBox {
Coordinates are relative to the owning flow. */
pure fn content_box() -> Rect<Au> {
match &self {
- &ImageBox(_,i) => {
+ &ImageBox(_, ref i) => {
let size = i.size();
Rect {
origin: copy self.d().position.origin,
@@ -426,7 +426,7 @@ impl RenderBox {
// TODO: items for background, border, outline
@GenericBox(_) => {
},
- @ImageBox(_,i) => {
+ @ImageBox(_, ref i) => {
match i.get_image() {
Some(image) => {
debug!("(building display list) building image box");
@@ -581,7 +581,7 @@ impl RenderBox : BoxedDebugMethods {
@GenericBox(*) => ~"GenericBox",
@ImageBox(*) => ~"ImageBox",
@TextBox(_,d) => fmt!("TextBox(text=%s)", str::substr(d.run.text, d.range.begin(), d.range.length())),
- @UnscannedTextBox(_,s) => fmt!("UnscannedTextBox(%s)", s)
+ @UnscannedTextBox(_, ref s) => fmt!("UnscannedTextBox(%s)", *s)
};
fmt!("box b%?: %?", self.d().id, repr)
diff --git a/src/servo/layout/box_builder.rs b/src/servo/layout/box_builder.rs
index 02dc1015286..fed07288b39 100644
--- a/src/servo/layout/box_builder.rs
+++ b/src/servo/layout/box_builder.rs
@@ -458,7 +458,7 @@ impl LayoutTreeBuilder {
~Text(*) => RenderBox_Text,
~Element(ref element) => {
match (&element.kind, display) {
- (&~HTMLImageElement(d), _) if d.image.is_some() => RenderBox_Image,
+ (&~HTMLImageElement(ref 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"
diff --git a/src/servo/layout/inline.rs b/src/servo/layout/inline.rs
index 2846f01d05d..3b3e886e970 100644
--- a/src/servo/layout/inline.rs
+++ b/src/servo/layout/inline.rs
@@ -621,7 +621,9 @@ impl FlowContext : InlineLayout {
// over the box list, and/or put into RenderBox.
for self.inline().boxes.each |box| {
box.d().position.size.width = match *box {
- @ImageBox(_,img) => Au::from_px(img.get_size().get_default(Size2D(0,0)).width),
+ @ImageBox(_, ref img) => {
+ Au::from_px(img.get_size().get_default(Size2D(0,0)).width)
+ }
@TextBox(*) => { /* text boxes are initialized with dimensions */
box.d().position.size.width
},
@@ -661,7 +663,7 @@ impl FlowContext : InlineLayout {
// compute box height.
cur_box.d().position.size.height = match cur_box {
- @ImageBox(_,img) => Au::from_px(img.size().height),
+ @ImageBox(_, ref img) => Au::from_px(img.size().height),
@TextBox(*) => { /* text boxes are initialized with dimensions */
cur_box.d().position.size.height
},
diff --git a/src/servo/layout/text.rs b/src/servo/layout/text.rs
index 52e2023702b..5447d741c96 100644
--- a/src/servo/layout/text.rs
+++ b/src/servo/layout/text.rs
@@ -39,7 +39,7 @@ trait UnscannedMethods {
impl RenderBox : UnscannedMethods {
pure fn raw_text() -> ~str {
match &self {
- &UnscannedTextBox(_, s) => copy s,
+ &UnscannedTextBox(_, ref s) => copy *s,
_ => fail ~"unsupported operation: box.raw_text() on non-unscanned text box."
}
}
diff --git a/src/servo/servo.rc b/src/servo/servo.rc
index dc5c5e80dd0..def59560c87 100755
--- a/src/servo/servo.rc
+++ b/src/servo/servo.rc
@@ -150,12 +150,12 @@ fn main() {
fn run(opts: &Opts) {
match &opts.render_mode {
&Screen => run_pipeline_screen(opts),
- &Png(outfile) => {
+ &Png(ref outfile) => {
assert opts.urls.is_not_empty();
if opts.urls.len() > 1u {
fail ~"servo asks that you stick to a single URL in PNG output mode"
}
- run_pipeline_png(opts, outfile)
+ run_pipeline_png(opts, *outfile)
}
}
}