Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed compile errors in the test suite

  • Loading branch information...
commit 8a79be869802bf9d85b38f76995e1d4be7de0ad2 1 parent 9196990
@mmeyerho mmeyerho authored
View
4 src/servo/gfx/pngsink.rs
@@ -24,6 +24,8 @@ import unsafe::reinterpret_cast;
import vec_from_buf = vec::unsafe::from_buf;
import ptr::addr_of;
import dom::event::Event;
+import dvec::dvec;
+import layout::display_list::display_list;
type PngSink = chan<Msg>;
@@ -127,7 +129,7 @@ fn sanity_check() {
let sink = PngSink(self_channel);
let renderer = Renderer(sink);
- let dlist = ~[];
+ let dlist : display_list = dvec();
renderer.send(RenderMsg(dlist));
listen(|from_renderer| {
renderer.send(renderer::ExitMsg(from_renderer));
View
20 src/servo/layout/display_list_builder.rs
@@ -113,9 +113,10 @@ fn should_convert_text_boxes_to_solid_color_background_items() {
let b = n.construct_boxes();
let subbox = alt check b.kind { TextBox(subbox) { subbox } };
b.reflow_text(px_to_au(800), subbox);
- let di = box_to_display_items(b, Point2D(px_to_au(0), px_to_au(0)));
+ let list = dvec();
+ box_to_display_items(list, b, Point2D(px_to_au(0), px_to_au(0)));
- alt di[0].item_type {
+ alt list[0].item_type {
dl::display_item_solid_color(*) { }
_ { fail }
}
@@ -131,9 +132,10 @@ fn should_convert_text_boxes_to_text_items() {
let b = n.construct_boxes();
let subbox = alt check b.kind { TextBox(subbox) { subbox } };
b.reflow_text(px_to_au(800), subbox);
- let di = box_to_display_items(b, Point2D(px_to_au(0), px_to_au(0)));
+ let list = dvec();
+ box_to_display_items(list, b, Point2D(px_to_au(0), px_to_au(0)));
- alt di[1].item_type {
+ alt list[1].item_type {
dl::display_item_text(_) { }
_ { fail }
}
@@ -148,14 +150,15 @@ fn should_calculate_the_bounds_of_the_text_box_background_color() {
let b = n.construct_boxes();
let subbox = alt check b.kind { TextBox(subbox) { subbox } };
b.reflow_text(px_to_au(800), subbox);
- let di = box_to_display_items(b, Point2D(px_to_au(0), px_to_au(0)));
+ let list = dvec();
+ box_to_display_items(list, b, Point2D(px_to_au(0), px_to_au(0)));
let expected = Rect(
Point2D(px_to_au(0), px_to_au(0)),
Size2D(px_to_au(84), px_to_au(20))
);
- assert di[0].bounds == expected;
+ assert list[0].bounds == expected;
}
fn should_calculate_the_bounds_of_the_text_items() {
@@ -167,12 +170,13 @@ fn should_calculate_the_bounds_of_the_text_items() {
let b = n.construct_boxes();
let subbox = alt check b.kind { TextBox(subbox) { subbox } };
b.reflow_text(px_to_au(800), subbox);
- let di = box_to_display_items(b, Point2D(px_to_au(0), px_to_au(0)));
+ let list = dvec();
+ box_to_display_items(list, b, Point2D(px_to_au(0), px_to_au(0)));
let expected = Rect(
Point2D(px_to_au(0), px_to_au(0)),
Size2D(px_to_au(84), px_to_au(20))
);
- assert di[1].bounds == expected;
+ assert list[1].bounds == expected;
}
Please sign in to comment.
Something went wrong with that request. Please try again.