diff options
Diffstat (limited to 'src/components/main')
-rw-r--r-- | src/components/main/compositing/compositor_layer.rs | 10 | ||||
-rw-r--r-- | src/components/main/compositing/quadtree.rs | 18 | ||||
-rw-r--r-- | src/components/main/compositing/run.rs | 6 | ||||
-rw-r--r-- | src/components/main/constellation.rs | 20 | ||||
-rw-r--r-- | src/components/main/layout/block.rs | 6 | ||||
-rw-r--r-- | src/components/main/layout/box.rs | 24 | ||||
-rw-r--r-- | src/components/main/layout/box_builder.rs | 40 | ||||
-rw-r--r-- | src/components/main/layout/float.rs | 10 | ||||
-rw-r--r-- | src/components/main/layout/float_context.rs | 20 | ||||
-rw-r--r-- | src/components/main/layout/flow.rs | 4 | ||||
-rw-r--r-- | src/components/main/layout/inline.rs | 80 | ||||
-rw-r--r-- | src/components/main/layout/layout_task.rs | 10 | ||||
-rw-r--r-- | src/components/main/layout/text.rs | 20 | ||||
-rw-r--r-- | src/components/main/layout/util.rs | 16 | ||||
-rw-r--r-- | src/components/main/pipeline.rs | 7 | ||||
-rw-r--r-- | src/components/main/platform/common/glfw_windowing.rs | 10 | ||||
-rw-r--r-- | src/components/main/platform/common/glut_windowing.rs | 10 | ||||
-rw-r--r-- | src/components/main/platform/common/shared_gl_windowing.rs | 2 | ||||
-rwxr-xr-x | src/components/main/servo.rc | 2 |
19 files changed, 155 insertions, 160 deletions
diff --git a/src/components/main/compositing/compositor_layer.rs b/src/components/main/compositing/compositor_layer.rs index 6877052ef2e..83d19deea8d 100644 --- a/src/components/main/compositing/compositor_layer.rs +++ b/src/components/main/compositing/compositor_layer.rs @@ -259,7 +259,7 @@ impl CompositorLayer { let mut redisplay: bool; { // block here to prevent double mutable borrow of self let quadtree = match self.quadtree { - NoTree(*) => fail!("CompositorLayer: cannot get buffer request for %?, + NoTree(*) => fail!("CompositorLayer: cannot get buffer request for {:?}, no quadtree initialized", self.pipeline.id), Tree(ref mut quadtree) => quadtree, }; @@ -452,14 +452,14 @@ impl CompositorLayer { // Add new tiles. let quadtree = match self.quadtree { - NoTree(*) => fail!("CompositorLayer: cannot build layer tree for %?, + NoTree(*) => fail!("CompositorLayer: cannot build layer tree for {:?}, no quadtree initialized", self.pipeline.id), Tree(ref mut quadtree) => quadtree, }; let all_tiles = quadtree.get_all_tiles(); for buffer in all_tiles.iter() { - debug!("osmain: compositing buffer rect %?", &buffer.rect); + debug!("osmain: compositing buffer rect {}", buffer.rect); let size = Size2D(buffer.screen_pos.size.width as int, buffer.screen_pos.size.height as int); @@ -478,7 +478,7 @@ impl CompositorLayer { // Make a new texture and bind the layer buffer's surface to it. let texture = Texture::new(target); - debug!("COMPOSITOR binding to native surface %d", + debug!("COMPOSITOR binding to native surface {:d}", buffer.native_surface.get_id() as int); buffer.native_surface.bind_to_texture(graphics_context, &texture, size); @@ -540,7 +540,7 @@ impl CompositorLayer { let cell = Cell::new(new_buffers); if self.pipeline.id == pipeline_id { if self.epoch != epoch { - debug!("compositor epoch mismatch: %? != %?, id: %?", + debug!("compositor epoch mismatch: {:?} != {:?}, id: {:?}", self.epoch, epoch, self.pipeline.id); diff --git a/src/components/main/compositing/quadtree.rs b/src/components/main/compositing/quadtree.rs index a46524e28f2..5ad48c1988e 100644 --- a/src/components/main/compositing/quadtree.rs +++ b/src/components/main/compositing/quadtree.rs @@ -304,7 +304,7 @@ impl<T: Tile> Quadtree<T> { /// Generate html to visualize the tree. For debugging purposes only. pub fn get_html(&self) -> ~str { - fmt!("%s<body>%s</body></html>", HEADER, self.root.get_html()) + format!("{:s}<body>{:s}</body></html>", HEADER, self.root.get_html()) } } @@ -374,7 +374,7 @@ impl<T: Tile> QuadtreeNode<T> { /// Returns an the difference in tile memory between the new quadtree node and the old quadtree node, /// along with any deleted tiles. fn add_tile(&mut self, x: f32, y: f32, tile: T, tile_size: f32) -> (int, ~[T]) { - debug!("Quadtree: Adding: (%?, %?) size:%?px", self.origin.x, self.origin.y, self.size); + debug!("Quadtree: Adding: ({}, {}) size:{}px", self.origin.x, self.origin.y, self.size); if x >= self.origin.x + self.size || x < self.origin.x || y >= self.origin.y + self.size || y < self.origin.y { @@ -741,33 +741,33 @@ impl<T: Tile> QuadtreeNode<T> { let mut ret = ~""; match self.tile { Some(ref tile) => { - ret = fmt!("%s%?", ret, tile); + ret = format!("{:s}{:?}", ret, tile); } None => { - ret = fmt!("%sNO TILE", ret); + ret = format!("{:s}NO TILE", ret); } } match self.quadrants { [None, None, None, None] => {} _ => { - ret = fmt!("%s<table border=1><tr>", ret); + ret = format!("{:s}<table border=1><tr>", ret); // FIXME: This should be inline, but currently won't compile let quads = [TL, TR, BL, BR]; for quad in quads.iter() { match self.quadrants[*quad as int] { Some(ref child) => { - ret = fmt!("%s<td>%s</td>", ret, child.get_html()); + ret = format!("{:s}<td>{:s}</td>", ret, child.get_html()); } None => { - ret = fmt!("%s<td>EMPTY CHILD</td>", ret); + ret = format!("{:s}<td>EMPTY CHILD</td>", ret); } } match *quad { - TR => ret = fmt!("%s</tr><tr>", ret), + TR => ret = format!("{:s}</tr><tr>", ret), _ => {} } } - ret = fmt!("%s</table>\n", ret); + ret = format!("{:s}</table>\n", ret); } } return ret; diff --git a/src/components/main/compositing/run.rs b/src/components/main/compositing/run.rs index 2b9e7a8cbbd..60f90359312 100644 --- a/src/components/main/compositing/run.rs +++ b/src/components/main/compositing/run.rs @@ -226,19 +226,19 @@ pub fn run_compositor(compositor: &CompositorTask) { ResizeWindowEvent(width, height) => { let new_size = Size2D(width, height); if window_size != new_size { - debug!("osmain: window resized to %ux%u", width, height); + debug!("osmain: window resized to {:u}x{:u}", width, height); window_size = new_size; match constellation_chan { Some(ref chan) => chan.send(ResizedWindowMsg(new_size)), None => error!("Compositor: Received resize event without initialized layout chan"), } } else { - debug!("osmain: dropping window resize since size is still %ux%u", width, height); + debug!("osmain: dropping window resize since size is still {:u}x{:u}", width, height); } } LoadUrlWindowEvent(url_string) => { - debug!("osmain: loading URL `%s`", url_string); + debug!("osmain: loading URL `{:s}`", url_string); let root_pipeline_id = match compositor_layer { Some(ref layer) => layer.pipeline.id.clone(), None => fail!("Compositor: Received LoadUrlWindowEvent without initialized compositor layers"), diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index e242c74ba48..3d9abea485c 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -212,7 +212,7 @@ impl NavigationContext { /// Loads a new set of page frames, returning all evicted frame trees pub fn load(&mut self, frame_tree: @mut FrameTree) -> ~[@mut FrameTree] { - debug!("navigating to %?", frame_tree.pipeline.id); + debug!("navigating to {:?}", frame_tree.pipeline.id); let evicted = replace(&mut self.next, ~[]); if self.current.is_some() { self.previous.push(self.current.take_unwrap()); @@ -419,7 +419,7 @@ impl Constellation { } fn handle_frame_rect_msg(&mut self, pipeline_id: PipelineId, subpage_id: SubpageId, rect: Rect<f32>) { - debug!("Received frame rect %? from %?, %?", rect, pipeline_id, subpage_id); + debug!("Received frame rect {} from {:?}, {:?}", rect, pipeline_id, subpage_id); let mut already_sent = HashSet::new(); // Returns true if a child frame tree's subpage id matches the given subpage id @@ -520,7 +520,7 @@ impl Constellation { source_url.port == url.port) && sandbox == IFrameUnsandboxed; // FIXME(tkuehn): Need to follow the standardized spec for checking same-origin let pipeline = @mut if same_script { - debug!("Constellation: loading same-origin iframe at %?", url); + debug!("Constellation: loading same-origin iframe at {:?}", url); // Reuse the script task if same-origin url's Pipeline::with_script(next_pipeline_id, Some(subpage_id), @@ -532,7 +532,7 @@ impl Constellation { source_pipeline, size_future) } else { - debug!("Constellation: loading cross-origin iframe at %?", url); + debug!("Constellation: loading cross-origin iframe at {:?}", url); // Create a new script task if not same-origin url's Pipeline::create(next_pipeline_id, Some(subpage_id), @@ -545,7 +545,7 @@ impl Constellation { size_future) }; - debug!("Constellation: sending load msg to pipeline %?", pipeline.id); + debug!("Constellation: sending load msg to pipeline {:?}", pipeline.id); pipeline.load(url); let rect = self.pending_sizes.pop(&(source_pipeline_id, subpage_id)); for frame_tree in frame_trees.iter() { @@ -562,7 +562,7 @@ impl Constellation { } fn handle_load_url_msg(&mut self, source_id: PipelineId, url: Url, size_future: Future<Size2D<uint>>) { - debug!("Constellation: received message to load %s", url.to_str()); + debug!("Constellation: received message to load {:s}", url.to_str()); // Make sure no pending page would be overridden. let source_frame = self.current_frame().get_ref().find(source_id).expect( "Constellation: received a LoadUrlMsg from a pipeline_id associated @@ -613,7 +613,7 @@ impl Constellation { } fn handle_navigate_msg(&mut self, direction: constellation_msg::NavigationDirection) { - debug!("received message to navigate %?", direction); + debug!("received message to navigate {:?}", direction); // TODO(tkuehn): what is the "critical point" beyond which pending frames // should not be cleared? Currently, the behavior is that forward/back @@ -655,7 +655,7 @@ impl Constellation { } fn handle_renderer_ready_msg(&mut self, pipeline_id: PipelineId) { - debug!("Renderer %? ready to send paint msg", pipeline_id); + debug!("Renderer {:?} ready to send paint msg", pipeline_id); // This message could originate from a pipeline in the navigation context or // from a pending frame. The only time that we will grant paint permission is // when the message originates from a pending frame or the current frame. @@ -691,7 +691,7 @@ impl Constellation { // If there are frames to revoke permission from, do so now. match frame_change.before { Some(revoke_id) => { - debug!("Constellation: revoking permission from %?", revoke_id); + debug!("Constellation: revoking permission from {:?}", revoke_id); let current_frame = self.current_frame().unwrap(); let to_revoke = current_frame.find(revoke_id).expect( @@ -705,7 +705,7 @@ impl Constellation { // If to_add is not the root frame, then replace revoked_frame with it. // This conveniently keeps scissor rect size intact. if to_add.parent.is_some() { - debug!("Constellation: replacing %? with %? in %?", + debug!("Constellation: replacing {:?} with {:?} in {:?}", revoke_id, to_add.pipeline.id, next_frame_tree.pipeline.id); next_frame_tree.replace_child(revoke_id, to_add); } diff --git a/src/components/main/layout/block.rs b/src/components/main/layout/block.rs index ba3b4746a63..7a852dbf117 100644 --- a/src/components/main/layout/block.rs +++ b/src/components/main/layout/block.rs @@ -360,7 +360,7 @@ impl FlowContext for BlockFlow { /// Dual boxes consume some width first, and the remainder is assigned to all child (block) /// contexts. fn assign_widths(&mut self, ctx: &mut LayoutContext) { - debug!("assign_widths_block: assigning width for flow %?", self.base.id); + debug!("assign_widths_block: assigning width for flow {}", self.base.id); if self.is_root { debug!("Setting root position"); self.base.position.origin = Au::zero_point(); @@ -433,12 +433,12 @@ impl FlowContext for BlockFlow { } fn assign_height_inorder(&mut self, ctx: &mut LayoutContext) { - debug!("assign_height_inorder: assigning height for block %?", self.base.id); + debug!("assign_height_inorder: assigning height for block {}", self.base.id); self.assign_height_block_base(ctx, true); } fn assign_height(&mut self, ctx: &mut LayoutContext) { - debug!("assign_height: assigning height for block %?", self.base.id); + debug!("assign_height: assigning height for block {}", self.base.id); // This is the only case in which a block flow can start an inorder // subtraversal. if self.is_root && self.base.num_floats > 0 { diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs index 364b6c03f70..5dc426d3af0 100644 --- a/src/components/main/layout/box.rs +++ b/src/components/main/layout/box.rs @@ -310,7 +310,7 @@ impl RenderBox for ImageRenderBox { let size = self.image.mutate().ptr.get_size(); let height = Au::from_px(size.unwrap_or(Size2D(0, 0)).height); self.base.position.mutate().ptr.size.height = height; - debug!("box_height: found image height: %?", height); + debug!("box_height: found image height: {}", height); height } @@ -343,7 +343,7 @@ impl TextRenderBox { /// /// FIXME(pcwalton): This API is confusing. pub fn new(base: RenderBoxBase, run: @TextRun, range: Range) -> TextRenderBox { - debug!("Creating textbox with span: (strlen=%u, off=%u, len=%u) of textrun (%s) (len=%u)", + debug!("Creating textbox with span: (strlen={:u}, off={:u}, len={:u}) of textrun ({:s}) (len={:u})", run.char_len(), range.begin(), range.length(), @@ -422,13 +422,13 @@ impl RenderBox for TextRenderBox { let mut left_range = Range::new(self.range.begin(), 0); let mut right_range: Option<Range> = None; - debug!("split_to_width: splitting text box (strlen=%u, range=%?, avail_width=%?)", + debug!("split_to_width: splitting text box (strlen={:u}, range={}, avail_width={})", self.run.text.get().len(), self.range, max_width); for (glyphs, offset, slice_range) in self.run.iter_slices_for_range(&self.range) { - debug!("split_to_width: considering slice (offset=%?, range=%?, remain_width=%?)", + debug!("split_to_width: considering slice (offset={}, range={}, remain_width={})", offset, slice_range, remaining_width); @@ -470,7 +470,7 @@ impl RenderBox for TextRenderBox { // the right chunk. let right_range_end = self.range.end() - slice_begin; right_range = Some(Range::new(slice_begin, right_range_end)); - debug!("split_to_width: case=splitting remainder with right range=%?", + debug!("split_to_width: case=splitting remainder with right range={:?}", right_range); } } @@ -728,7 +728,7 @@ impl RenderBoxBase { pub fn font_style(&self) -> FontStyle { let my_style = self.nearest_ancestor_element().style(); - debug!("(font style) start: %?", self.nearest_ancestor_element().type_id()); + debug!("(font style) start: {:?}", self.nearest_ancestor_element().type_id()); // FIXME: Too much allocation here. let font_families = do my_style.Font.font_family.map |family| { @@ -737,10 +737,10 @@ impl RenderBoxBase { } }; let font_families = font_families.connect(", "); - debug!("(font style) font families: `%s`", font_families); + debug!("(font style) font families: `{:s}`", font_families); let font_size = my_style.Font.font_size.to_f64().unwrap() / 60.0; - debug!("(font style) font size: `%fpx`", font_size); + debug!("(font style) font size: `{:f}px`", font_size); let (italic, oblique) = match my_style.Font.font_style { font_style::normal => (false, false), @@ -948,9 +948,9 @@ impl RenderBoxUtils for @RenderBox { let base = self.base(); let box_bounds = base.position.get(); let absolute_box_bounds = box_bounds.translate(offset); - debug!("RenderBox::build_display_list at rel=%?, abs=%?: %s", + debug!("RenderBox::build_display_list at rel={}, abs={}: {:s}", box_bounds, absolute_box_bounds, self.debug_str()); - debug!("RenderBox::build_display_list: dirty=%?, offset=%?", dirty, offset); + debug!("RenderBox::build_display_list: dirty={}, offset={}", *dirty, *offset); if absolute_box_bounds.intersects(dirty) { debug!("RenderBox::build_display_list: intersected. Adding display item..."); @@ -990,7 +990,7 @@ impl RenderBoxUtils for @RenderBox { // // FIXME(pcwalton): This is a bit of an abuse of the logging infrastructure. We // should have a real `SERVO_DEBUG` system. - debug!("%?", { + debug!("{:?}", { // Compute the text box bounds and draw a border surrounding them. let debug_border = SideOffsets2D::new_all_same(Au::from_px(1)); @@ -1039,7 +1039,7 @@ impl RenderBoxUtils for @RenderBox { // FIXME(pcwalton): This is a bit of an abuse of the logging infrastructure. We // should have a real `SERVO_DEBUG` system. - debug!("%?", { + debug!("{:?}", { let debug_border = SideOffsets2D::new_all_same(Au::from_px(1)); do list.with_mut_ref |list| { diff --git a/src/components/main/layout/box_builder.rs b/src/components/main/layout/box_builder.rs index e2cff941d97..6b72794a121 100644 --- a/src/components/main/layout/box_builder.rs +++ b/src/components/main/layout/box_builder.rs @@ -70,7 +70,7 @@ impl<'self> BoxGenerator<'self> { /* Debug ids only */ fn new(flow: &'self mut FlowContext) -> BoxGenerator<'self> { - debug!("Creating box generator for flow: %s", flow.debug_str()); + debug!("Creating box generator for flow: {:s}", flow.debug_str()); BoxGenerator { flow: flow, range_stack: @mut ~[] @@ -105,12 +105,12 @@ impl<'self> BoxGenerator<'self> { ctx: &LayoutContext, node: AbstractNode<LayoutView>, builder: &mut LayoutTreeBuilder) { - debug!("BoxGenerator[f%d]: pushing node: %s", flow::base(self.flow).id, node.debug_str()); + debug!("BoxGenerator[f{:d}]: pushing node: {:s}", flow::base(self.flow).id, node.debug_str()); // TODO: remove this once UA styles work let box_type = self.decide_box_type(node); - debug!("BoxGenerator[f%d]: point a", flow::base(self.flow).id); + debug!("BoxGenerator[f{:d}]: point a", flow::base(self.flow).id); let range_stack = &mut self.range_stack; // depending on flow, make a box for this node. @@ -135,10 +135,10 @@ impl<'self> BoxGenerator<'self> { }, BlockFlowClass => { let block = self.flow.as_block(); - debug!("BoxGenerator[f%d]: point b", block.base.id); + debug!("BoxGenerator[f{:d}]: point b", block.base.id); let new_box = BoxGenerator::make_box(ctx, box_type, node, builder); - debug!("BoxGenerator[f%d]: attaching box[b%d] to block flow (node: %s)", + debug!("BoxGenerator[f{:d}]: attaching box[b{:d}] to block flow (node: {:s})", block.base.id, new_box.base().id(), node.debug_str()); @@ -148,11 +148,11 @@ impl<'self> BoxGenerator<'self> { } FloatFlowClass => { let float = self.flow.as_float(); - debug!("BoxGenerator[f%d]: point b", float.base.id); + debug!("BoxGenerator[f{:d}]: point b", float.base.id); let new_box = BoxGenerator::make_box(ctx, box_type, node, builder); - debug!("BoxGenerator[f%d]: attaching box[b%d] to float flow (node: %s)", + debug!("BoxGenerator[f{:d}]: attaching box[b{:d}] to float flow (node: {:s})", float.base.id, new_box.base().id(), node.debug_str()); @@ -160,12 +160,12 @@ impl<'self> BoxGenerator<'self> { assert!(float.box.is_none() && float.index.is_none()); float.box = Some(new_box); } - _ => warn!("push_node() not implemented for flow f%d", flow::base(self.flow).id), + _ => warn!("push_node() not implemented for flow f{:d}", flow::base(self.flow).id), } } pub fn pop_node(&mut self, ctx: &LayoutContext, node: AbstractNode<LayoutView>) { - debug!("BoxGenerator[f%d]: popping node: %s", flow::base(self.flow).id, node.debug_str()); + debug!("BoxGenerator[f{:d}]: popping node: {:s}", flow::base(self.flow).id, node.debug_str()); match self.flow.class() { InlineFlowClass => { @@ -188,12 +188,12 @@ impl<'self> BoxGenerator<'self> { warn!("node range length is zero?!") } - debug!("BoxGenerator: adding element range=%?", node_range); + debug!("BoxGenerator: adding element range={}", node_range); inline.elems.add_mapping(node, &node_range); }, BlockFlowClass => assert!(self.range_stack.len() == 0), FloatFlowClass => assert!(self.range_stack.len() == 0), - _ => warn!("pop_node() not implemented for flow %?", flow::base(self.flow).id), + _ => warn!("pop_node() not implemented for flow {:?}", flow::base(self.flow).id), } } @@ -212,7 +212,7 @@ impl<'self> BoxGenerator<'self> { } ImageRenderBoxClass => BoxGenerator::make_image_box(layout_ctx, node, base), }; - debug!("BoxGenerator: created box: %s", result.debug_str()); + debug!("BoxGenerator: created box: {:s}", result.debug_str()); result } @@ -289,7 +289,7 @@ impl LayoutTreeBuilder { mut parent_generator: BoxGenerator<'a>, mut prev_sibling_generator: Option<BoxGenerator<'a>>) -> BoxConstructResult<'a> { - debug!("Considering node: %s", cur_node.debug_str()); + debug!("Considering node: {:s}", cur_node.debug_str()); let box_gen_result = { let grandparent_gen_ref = match grandparent_generator { Some(ref mut generator) => Some(generator), @@ -304,7 +304,7 @@ impl LayoutTreeBuilder { let mut reparent = false; - debug!("result from generator_for_node: %?", &box_gen_result); + debug!("result from generator_for_node: {:?}", &box_gen_result); // Skip over nodes that don't belong in the flow tree let (this_generator, next_generator) = match box_gen_result { NoGenerator => return Normal(prev_sibling_generator), @@ -332,9 +332,9 @@ impl LayoutTreeBuilder { let mut this_generator = this_generator; - debug!("point a: %s", cur_node.debug_str()); + debug!("point a: {:s}", cur_node.debug_str()); this_generator.push_node(layout_ctx, cur_node, self); - debug!("point b: %s", cur_node.debug_str()); + debug!("point b: {:s}", cur_node.debug_str()); // recurse on child nodes. let prev_gen_cell = Cell::new(Normal(None)); @@ -571,7 +571,7 @@ impl LayoutTreeBuilder { let first_box = boxes[0]; // FIXME(pcwalton): Rust bug if first_box.is_whitespace_only() { debug!("LayoutTreeBuilder: pruning whitespace-only first \ - child flow f%d from parent f%d", + child flow f{:d} from parent f{:d}", first_inline_flow.base.id, p_id); do_remove = true; @@ -599,7 +599,7 @@ impl LayoutTreeBuilder { let last_box = boxes.last(); // FIXME(pcwalton): Rust bug if last_box.is_whitespace_only() { debug!("LayoutTreeBuilder: pruning whitespace-only last \ - child flow f%d from parent f%d", + child flow f{:d} from parent f{:d}", last_inline_flow.base.id, p_id); do_remove = true; @@ -638,7 +638,7 @@ impl LayoutTreeBuilder { pub fn construct_trees(&mut self, layout_ctx: &LayoutContext, root: AbstractNode<LayoutView>) -> Result<~FlowContext:, ()> { debug!("Constructing flow tree for DOM: "); - debug!("%?", root.dump()); + debug!("{:?}", root.dump()); let mut new_flow = self.make_flow(RootFlowType, root); { @@ -661,7 +661,7 @@ impl LayoutTreeBuilder { RootFlowType => ~BlockFlow::new_root(info) as ~FlowContext:, TableFlowType => ~TableFlow::new(info) as ~FlowContext:, }; - debug!("LayoutTreeBuilder: created flow: %s", result.debug_str()); + debug!("LayoutTreeBuilder: created flow: {:s}", result.debug_str()); result } } diff --git a/src/components/main/layout/float.rs b/src/components/main/layout/float.rs index 8aee9e4837a..47f6dd12f9b 100644 --- a/src/components/main/layout/float.rs +++ b/src/components/main/layout/float.rs @@ -137,7 +137,7 @@ impl FlowContext for FloatFlow { } fn assign_widths(&mut self, _: &mut LayoutContext) { - debug!("assign_widths_float: assigning width for flow %?", self.base.id); + debug!("assign_widths_float: assigning width for flow {}", self.base.id); // position.size.width is set by parent even though we don't know // position.origin yet. let mut remaining_width = self.base.position.size.width; @@ -174,7 +174,7 @@ impl FlowContext for FloatFlow { let width = MaybeAuto::from_style(style.Box.width, remaining_width).specified_or_default(shrink_to_fit); - debug!("assign_widths_float -- width: %?", width); + debug!("assign_widths_float -- width: {}", width); model.margin.top = margin_top; model.margin.right = margin_right; @@ -210,7 +210,7 @@ impl FlowContext for FloatFlow { } fn assign_height_inorder(&mut self, _: &mut LayoutContext) { - debug!("assign_height_inorder_float: assigning height for float %?", self.base.id); + debug!("assign_height_inorder_float: assigning height for float {}", self.base.id); // assign_height_float was already called by the traversal function // so this is well-defined @@ -250,7 +250,7 @@ impl FlowContext for FloatFlow { } fn assign_height(&mut self, ctx: &mut LayoutContext) { - debug!("assign_height_float: assigning height for float %?", self.base.id); + debug!("assign_height_float: assigning height for float {}", self.base.id); let has_inorder_children = self.base.num_floats > 0; if has_inorder_children { let mut float_ctx = FloatContext::new(self.floated_children); @@ -298,7 +298,7 @@ impl FlowContext for FloatFlow { Au::new(0)).specified_or_zero(); height = geometry::max(height, height_prop) + noncontent_height; - debug!("assign_height_float -- height: %?", height); + debug!("assign_height_float -- height: {}", height); position.size.height = height; } diff --git a/src/components/main/layout/float_context.rs b/src/components/main/layout/float_context.rs index 5786cf369ae..45e142b24b9 100644 --- a/src/components/main/layout/float_context.rs +++ b/src/components/main/layout/float_context.rs @@ -128,7 +128,7 @@ impl FloatContext { impl FloatContextBase{ fn new(num_floats: uint) -> FloatContextBase { - debug!("Creating float context of size %?", num_floats); + debug!("Creating float context of size {}", num_floats); FloatContextBase { float_data: if num_floats == 0 { None @@ -151,7 +151,7 @@ impl FloatContextBase{ match self.float_data.get_ref()[self.floats_used - 1] { None => fail!("FloatContext error: floats should never be None here"), Some(float) => { - debug!("Returning float position: %?", float.bounds.origin + self.offset); + debug!("Returning float position: {}", float.bounds.origin + self.offset); float.bounds.origin + self.offset } } @@ -168,7 +168,7 @@ impl FloatContextBase{ let top = top - self.offset.y; - debug!("available_rect: trying to find space at %?", top); + debug!("available_rect: trying to find space at {}", top); // Relevant dimensions for the right-most left float let mut max_left = Au(0) - self.offset.x; @@ -188,7 +188,7 @@ impl FloatContextBase{ Some(data) => { let float_pos = data.bounds.origin; let float_size = data.bounds.size; - debug!("float_pos: %?, float_size: %?", float_pos, float_size); + debug!("float_pos: {}, float_size: {}", float_pos, float_size); match data.f_type { FloatLeft => { if(float_pos.x + float_size.width > max_left && @@ -198,7 +198,7 @@ impl FloatContextBase{ l_top = Some(float_pos.y); l_bottom = Some(float_pos.y + float_size.height); - debug!("available_rect: collision with left float: new max_left is %?", + debug!("available_rect: collision with left float: new max_left is {}", max_left); } } @@ -209,7 +209,7 @@ impl FloatContextBase{ r_top = Some(float_pos.y); r_bottom = Some(float_pos.y + float_size.height); - debug!("available_rect: collision with right float: new min_right is %?", + debug!("available_rect: collision with right float: new min_right is {}", min_right); } } @@ -249,7 +249,7 @@ impl FloatContextBase{ fn add_float(&mut self, info: &PlacementInfo) { assert!(self.float_data.is_some()); - debug!("Floats_used: %?, Floats available: %?", + debug!("Floats_used: {}, Floats available: {}", self.floats_used, self.float_data.get_ref().len()); assert!(self.floats_used < self.float_data.get_ref().len() && @@ -263,7 +263,7 @@ impl FloatContextBase{ f_type: info.f_type }; - debug!("add_float: added float with info %?", new_info); + debug!("add_float: added float with info {:?}", new_info); let new_float = FloatData { bounds: Rect { @@ -325,13 +325,13 @@ impl FloatContextBase{ /// Given necessary info, finds the closest place a box can be positioned /// without colliding with any floats. fn place_between_floats(&self, info: &PlacementInfo) -> Rect<Au>{ - debug!("place_float: Placing float with width %? and height %?", info.width, info.height); + debug!("place_float: Placing float with width {} and height {}", info.width, info.height); // Can't go any higher than previous floats or // previous elements in the document. let mut float_y = info.ceiling; loop { let maybe_location = self.available_rect(float_y, info.height, info.max_width); - debug!("place_float: Got available rect: %? for y-pos: %?", maybe_location, float_y); + debug!("place_float: Got available rect: {:?} for y-pos: {}", maybe_location, float_y); match maybe_location { // If there are no floats blocking us, return the current location diff --git a/src/components/main/layout/flow.rs b/src/components/main/layout/flow.rs index 35e06902f8f..abbc39a50d9 100644 --- a/src/components/main/layout/flow.rs +++ b/src/components/main/layout/flow.rs @@ -496,12 +496,12 @@ impl<'self> MutableFlowUtils for &'self mut FlowContext { dirty: &Rect<Au>, list: &Cell<DisplayList<E>>) -> bool { - debug!("FlowContext: building display list for f%?", base(self).id); + debug!("FlowContext: building display list for f{}", base(self).id); match self.class() { BlockFlowClass => self.as_block().build_display_list_block(builder, dirty, list), InlineFlowClass => self.as_inline().build_display_list_inline(builder, dirty, list), FloatFlowClass => self.as_float().build_display_list_float(builder, dirty, list), - _ => fail!("Tried to build_display_list_recurse of flow: %?", self), + _ => fail!("Tried to build_display_list_recurse of flow: {:?}", self), } } } diff --git a/src/components/main/layout/inline.rs b/src/components/main/layout/inline.rs index 037b782edf0..a15f739ba05 100644 --- a/src/components/main/layout/inline.rs +++ b/src/components/main/layout/inline.rs @@ -103,7 +103,7 @@ impl LineboxScanner { } fn reset_scanner(&mut self, flow: &mut InlineFlow) { - debug!("Resetting line box scanner's state for flow f%d.", flow.base.id); + debug!("Resetting line box scanner's state for flow f{:d}.", flow.base.id); self.lines = ~[]; self.new_boxes = ~[]; self.cur_y = Au::new(0); @@ -128,26 +128,26 @@ impl LineboxScanner { break } let box = flow.boxes[i]; i += 1; - debug!("LineboxScanner: Working with box from box list: b%d", box.base().id()); + debug!("LineboxScanner: Working with box from box list: b{:d}", box.base().id()); box } else { let box = self.work_list.pop_front().unwrap(); - debug!("LineboxScanner: Working with box from work list: b%d", box.base().id()); + debug!("LineboxScanner: Working with box from work list: b{:d}", box.base().id()); box }; let box_was_appended = self.try_append_to_line(cur_box, flow); if !box_was_appended { - debug!("LineboxScanner: Box wasn't appended, because line %u was full.", + debug!("LineboxScanner: Box wasn't appended, because line {:u} was full.", self.lines.len()); self.flush_current_line(); } else { - debug!("LineboxScanner: appended a box to line %u", self.lines.len()); + debug!("LineboxScanner: appended a box to line {:u}", self.lines.len()); } } if self.pending_line.range.length() > 0 { - debug!("LineboxScanner: Partially full linebox %u left at end of scanning.", + debug!("LineboxScanner: Partially full linebox {:u} left at end of scanning.", self.lines.len()); self.flush_current_line(); } @@ -158,7 +158,7 @@ impl LineboxScanner { } fn swap_out_results(&mut self, flow: &mut InlineFlow) { - debug!("LineboxScanner: Propagating scanned lines[n=%u] to inline flow f%d", + debug!("LineboxScanner: Propagating scanned lines[n={:u}] to inline flow f{:d}", self.lines.len(), flow.base.id); @@ -167,11 +167,11 @@ impl LineboxScanner { } fn flush_current_line(&mut self) { - debug!("LineboxScanner: Flushing line %u: %?", + debug!("LineboxScanner: Flushing line {:u}: {:?}", self.lines.len(), self.pending_line); // clear line and add line mapping - debug!("LineboxScanner: Saving information for flushed line %u.", self.lines.len()); + debug!("LineboxScanner: Saving information for flushed line {:u}.", self.lines.len()); self.lines.push(self.pending_line); self.cur_y = self.pending_line.bounds.origin.y + self.pending_line.bounds.size.height; self.reset_linebox(); @@ -193,10 +193,10 @@ impl LineboxScanner { /// with the line's origin) and the actual width of the first box after splitting. fn initial_line_placement(&self, first_box: @RenderBox, ceiling: Au, flow: &mut InlineFlow) -> (Rect<Au>, Au) { - debug!("LineboxScanner: Trying to place first box of line %?", self.lines.len()); + debug!("LineboxScanner: Trying to place first box of line {}", self.lines.len()); let first_box_size = first_box.base().position.get().size; - debug!("LineboxScanner: box size: %?", first_box_size); + debug!("LineboxScanner: box size: {}", first_box_size); let splitable = first_box.can_split(); let line_is_empty: bool = self.pending_line.range.length() == 0; @@ -219,7 +219,7 @@ impl LineboxScanner { let line_bounds = self.floats.place_between_floats(&info); - debug!("LineboxScanner: found position for line: %? using placement_info: %?", + debug!("LineboxScanner: found position for line: {} using placement_info: {:?}", line_bounds, info); @@ -242,7 +242,7 @@ impl LineboxScanner { // try_append_to_line. match first_box.split_to_width(line_bounds.size.width, line_is_empty) { CannotSplit(_) => { - error!("LineboxScanner: Tried to split unsplittable render box! %s", + error!("LineboxScanner: Tried to split unsplittable render box! {:s}", first_box.debug_str()); return (line_bounds, first_box_size.width); } @@ -273,7 +273,7 @@ impl LineboxScanner { info.width = actual_box_width; let new_bounds = self.floats.place_between_floats(&info); - debug!("LineboxScanner: case=new line position: %?", new_bounds); + debug!("LineboxScanner: case=new line position: {}", new_bounds); return (new_bounds, actual_box_width); } } @@ -290,8 +290,8 @@ impl LineboxScanner { self.pending_line.green_zone = line_bounds.size; } - debug!("LineboxScanner: Trying to append box to line %u (box size: %?, green zone: \ - %?): %s", + debug!("LineboxScanner: Trying to append box to line {:u} (box size: {}, green zone: \ + {}): {:s}", self.lines.len(), in_box.base().position.get().size, self.pending_line.green_zone, @@ -361,7 +361,7 @@ impl LineboxScanner { if !in_box.can_split() { // TODO(Issue #224): signal that horizontal overflow happened? if line_is_empty { - debug!("LineboxScanner: case=box can't split and line %u is empty, so \ + debug!("LineboxScanner: case=box can't split and line {:u} is empty, so \ overflowing.", self.lines.len()); self.push_box_to_line(in_box); @@ -375,7 +375,7 @@ impl LineboxScanner { match in_box.split_to_width(available_width, line_is_empty) { CannotSplit(_) => { - error!("LineboxScanner: Tried to split unsplittable render box! %s", + error!("LineboxScanner: Tried to split unsplittable render box! {:s}", in_box.debug_str()); return false; } @@ -394,7 +394,7 @@ impl LineboxScanner { } SplitDidNotFit(left, right) => { if line_is_empty { - debug!("LineboxScanner: case=split box didn't fit and line %u is empty, so overflowing and deferring remainder box.", + debug!("LineboxScanner: case=split box didn't fit and line {:u} is empty, so overflowing and deferring remainder box.", self.lines.len()); // TODO(Issue #224): signal that horizontal overflow happened? match (left, right) { @@ -425,7 +425,7 @@ impl LineboxScanner { // unconditional push fn push_box_to_line(&mut self, box: @RenderBox) { - debug!("LineboxScanner: Pushing box b%d to line %u", box.base().id(), self.lines.len()); + debug!("LineboxScanner: Pushing box b{:d} to line {:u}", box.base().id(), self.lines.len()); if self.pending_line.range.length() == 0 { assert!(self.new_boxes.len() <= (u16::max_value as uint)); @@ -492,7 +492,7 @@ impl InlineFlow { // TODO(#228): Once we form line boxes and have their cached bounds, we can be smarter and // not recurse on a line if nothing in it can intersect the dirty region. - debug!("FlowContext[%d]: building display list for %u inline boxes", + debug!("FlowContext[{:d}]: building display list for {:u} inline boxes", self.base.id, self.boxes.len()); @@ -530,24 +530,20 @@ impl FlowContext for InlineFlow { child_base.floats_in = FloatContext::new(child_base.num_floats); } - { - let this = &mut *self; + let mut min_width = Au::new(0); + let mut pref_width = Au::new(0); - let mut min_width = Au::new(0); - let mut pref_width = Au::new(0); - - for box in this.boxes.iter() { - debug!("FlowContext[%d]: measuring %s", self.base.id, box.debug_str()); - let (this_minimum_width, this_preferred_width) = - box.minimum_and_preferred_widths(); - min_width = Au::max(min_width, this_minimum_width); - pref_width = Au::max(pref_width, this_preferred_width); - } - - this.base.min_width = min_width; - this.base.pref_width = pref_width; - this.base.num_floats = num_floats; + for box in self.boxes.iter() { + debug!("FlowContext[{:d}]: measuring {:s}", self.base.id, box.debug_str()); + let (this_minimum_width, this_preferred_width) = + box.minimum_and_preferred_widths(); + min_width = Au::max(min_width, this_minimum_width); + pref_width = Au::max(pref_width, this_preferred_width); } + + self.base.min_width = min_width; + self.base.pref_width = pref_width; + self.base.num_floats = num_floats; } /// Recursively (top-down) determines the actual width of child contexts and boxes. When called @@ -558,7 +554,7 @@ impl FlowContext for InlineFlow { // TODO: Combine this with `LineboxScanner`'s walk in the box list, or put this into // `RenderBox`. - debug!("assign_widths_inline: floats_in: %?", self.base.floats_in); + debug!("assign_widths_inline: floats_in: {:?}", self.base.floats_in); { let this = &mut *self; for &box in this.boxes.iter() { @@ -588,7 +584,7 @@ impl FlowContext for InlineFlow { } fn assign_height(&mut self, _: &mut LayoutContext) { - debug!("assign_height_inline: assigning height for flow %?", self.base.id); + debug!("assign_height_inline: assigning height for flow {}", self.base.id); // Divide the boxes into lines // TODO(#226): Get the CSS `line-height` property from the containing block's style to @@ -598,7 +594,7 @@ impl FlowContext for InlineFlow { // determine its height for computing linebox height. // // TODO(pcwalton): Cache the linebox scanner? - debug!("assign_height_inline: floats_in: %?", self.base.floats_in); + debug!("assign_height_inline: floats_in: {:?}", self.base.floats_in); let scanner_floats = self.base.floats_in.clone(); let mut scanner = LineboxScanner::new(scanner_floats); @@ -729,8 +725,8 @@ impl FlowContext for InlineFlow { }, // FIXME(pcwalton): This isn't very type safe! _ => { - fail!(fmt!("Tried to assign height to unknown Box variant: %s", - cur_box.debug_str())) + fail!("Tried to assign height to unknown Box variant: {:s}", + cur_box.debug_str()) } }; let mut top_from_base = top_from_base; diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index 046f2518ffe..a894ffc3896 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -330,10 +330,10 @@ impl LayoutTask { // FIXME: Bad copy! let doc_url = data.url.clone(); - debug!("layout: received layout request for: %s", doc_url.to_str()); - debug!("layout: damage is %?", data.damage); + debug!("layout: received layout request for: {:s}", doc_url.to_str()); + debug!("layout: damage is {:?}", data.damage); debug!("layout: parsed Node tree"); - debug!("%?", node.dump()); + debug!("{:?}", node.dump()); // Reset the image cache. self.local_image_cache.next_round(self.make_on_image_available_cb()); @@ -341,7 +341,7 @@ impl LayoutTask { let screen_size = Size2D(Au::from_px(data.window_size.width as int), Au::from_px(data.window_size.height as int)); let resized = self.screen_size != Some(screen_size); - debug!("resized: %?", resized); + debug!("resized: {}", resized); self.screen_size = Some(screen_size); // Create a layout context for use throughout the following passes. @@ -384,7 +384,7 @@ impl LayoutTask { layout_root.traverse_postorder(&mut ComputeDamageTraversal.clone()); debug!("layout: constructed Flow tree"); - debug!("%?", layout_root.dump()); + debug!("{:?}", layout_root.dump()); // Perform the primary layout passes over the flow tree to compute the locations of all // the boxes. diff --git a/src/components/main/layout/text.rs b/src/components/main/layout/text.rs index 77a8831d137..e18538fe44f 100644 --- a/src/components/main/layout/text.rs +++ b/src/components/main/layout/text.rs @@ -31,13 +31,13 @@ impl TextRunScanner { // FIXME: this assertion fails on wikipedia, but doesn't seem // to cause problems. // assert!(inline.boxes.len() > 0); - debug!("TextRunScanner: scanning %u boxes for text runs...", inline.boxes.len()); + debug!("TextRunScanner: scanning {:u} boxes for text runs...", inline.boxes.len()); } let mut last_whitespace = true; let mut out_boxes = ~[]; for box_i in range(0, flow.as_immutable_inline().boxes.len()) { - debug!("TextRunScanner: considering box: %u", box_i); + debug!("TextRunScanner: considering box: {:u}", box_i); if box_i > 0 && !can_coalesce_text_nodes(flow.as_immutable_inline().boxes, box_i - 1, box_i) { @@ -92,7 +92,7 @@ impl TextRunScanner { assert!(self.clump.length() > 0); - debug!("TextRunScanner: flushing boxes in range=%?", self.clump); + debug!("TextRunScanner: flushing boxes in range={}", self.clump); let is_singleton = self.clump.length() == 1; let possible_text_clump = in_boxes[self.clump.begin()]; // FIXME(pcwalton): Rust bug let is_text_clump = possible_text_clump.class() == UnscannedTextRenderBoxClass; @@ -104,7 +104,7 @@ impl TextRunScanner { fail!(~"WAT: can't coalesce non-text nodes in flush_clump_to_list()!") } (true, false) => { - debug!("TextRunScanner: pushing single non-text box in range: %?", self.clump); + debug!("TextRunScanner: pushing single non-text box in range: {}", self.clump); out_boxes.push(in_boxes[self.clump.begin()]); }, (true, true) => { @@ -126,7 +126,7 @@ impl TextRunScanner { let fontgroup = ctx.font_ctx.get_resolved_font_for_style(&font_style); let run = @fontgroup.create_textrun(transformed_text, decoration); - debug!("TextRunScanner: pushing single text box in range: %? (%?)", self.clump, text); + debug!("TextRunScanner: pushing single text box in range: {} ({})", self.clump, text); let range = Range::new(0, run.char_len()); let new_box = @TextRenderBox::new((*old_box.base()).clone(), run, range); @@ -185,12 +185,12 @@ impl TextRunScanner { }; // Make new boxes with the run and adjusted text indices. - debug!("TextRunScanner: pushing box(es) in range: %?", self.clump); + debug!("TextRunScanner: pushing box(es) in range: {}", self.clump); for i in clump.eachi() { let range = new_ranges[i - self.clump.begin()]; if range.length() == 0 { debug!("Elided an `UnscannedTextbox` because it was zero-length after \ - compression; %s", + compression; {:s}", in_boxes[i].debug_str()); continue } @@ -205,19 +205,19 @@ impl TextRunScanner { debug!("--- In boxes: ---"); for (i, box) in in_boxes.iter().enumerate() { - debug!("%u --> %s", i, box.debug_str()); + debug!("{:u} --> {:s}", i, box.debug_str()); } debug!("------------------"); debug!("--- Out boxes: ---"); for (i, box) in out_boxes.iter().enumerate() { - debug!("%u --> %s", i, box.debug_str()); + debug!("{:u} --> {:s}", i, box.debug_str()); } debug!("------------------"); debug!("--- Elem ranges: ---"); for (i, nr) in inline.elems.eachi() { - debug!("%u: %? --> %s", i, nr.range, nr.node.debug_str()); () + debug!("{:u}: {} --> {:s}", i, nr.range, nr.node.debug_str()); () } debug!("--------------------"); diff --git a/src/components/main/layout/util.rs b/src/components/main/layout/util.rs index 7701aa2bd66..cf6d38ee7a0 100644 --- a/src/components/main/layout/util.rs +++ b/src/components/main/layout/util.rs @@ -51,19 +51,19 @@ impl ElementMapping { debug!("--- Old boxes: ---"); for (i, box) in old_boxes.iter().enumerate() { - debug!("%u --> %s", i, box.debug_str()); + debug!("{:u} --> {:s}", i, box.debug_str()); } debug!("------------------"); debug!("--- New boxes: ---"); for (i, box) in new_boxes.iter().enumerate() { - debug!("%u --> %s", i, box.debug_str()); + debug!("{:u} --> {:s}", i, box.debug_str()); } debug!("------------------"); debug!("--- Elem ranges before repair: ---"); for (i, nr) in entries.iter().enumerate() { - debug!("%u: %? --> %s", i, nr.range, nr.node.debug_str()); + debug!("{:u}: {} --> {:s}", i, nr.range, nr.node.debug_str()); } debug!("----------------------------------"); @@ -80,17 +80,17 @@ impl ElementMapping { let mut entries_k = 0; while old_i < old_boxes.len() { - debug!("repair_for_box_changes: Considering old box %u", old_i); + debug!("repair_for_box_changes: Considering old box {:u}", old_i); // possibly push several items while entries_k < entries.len() && old_i == entries[entries_k].range.begin() { let item = WorkItem {begin_idx: new_j, entry_idx: entries_k}; - debug!("repair_for_box_changes: Push work item for elem %u: %?", entries_k, item); + debug!("repair_for_box_changes: Push work item for elem {:u}: {:?}", entries_k, item); repair_stack.push(item); entries_k += 1; } while new_j < new_boxes.len() && old_boxes[old_i].base().node != new_boxes[new_j].base().node { - debug!("repair_for_box_changes: Slide through new box %u", new_j); + debug!("repair_for_box_changes: Slide through new box {:u}", new_j); new_j += 1; } @@ -99,14 +99,14 @@ impl ElementMapping { // possibly pop several items while repair_stack.len() > 0 && old_i == entries[repair_stack.last().entry_idx].range.end() { let item = repair_stack.pop(); - debug!("repair_for_box_changes: Set range for %u to %?", + debug!("repair_for_box_changes: Set range for {:u} to {}", item.entry_idx, Range::new(item.begin_idx, new_j - item.begin_idx)); entries[item.entry_idx].range = Range::new(item.begin_idx, new_j - item.begin_idx); } } debug!("--- Elem ranges after repair: ---"); for (i, nr) in entries.iter().enumerate() { - debug!("%u: %? --> %s", i, nr.range, nr.node.debug_str()); + debug!("{:u}: {} --> {:s}", i, nr.range, nr.node.debug_str()); } debug!("----------------------------------"); } diff --git a/src/components/main/pipeline.rs b/src/components/main/pipeline.rs index 9c89a07fb4e..7b619de378a 100644 --- a/src/components/main/pipeline.rs +++ b/src/components/main/pipeline.rs @@ -101,9 +101,8 @@ impl Pipeline { // Wrap task creation within a supervised task so that failure will // only tear down those tasks instead of ours. let failure_chan = constellation_chan.clone(); - let (task_port, task_chan) = stream::<task::TaskResult>(); let mut supervised_task = task::task(); - supervised_task.opts.notify_chan = Some(task_chan); + let task_port = supervised_task.future_result(); supervised_task.supervised(); spawn_with!(supervised_task, [script_port, resource_task, size, render_port, @@ -138,8 +137,8 @@ impl Pipeline { spawn_with!(task::task(), [failure_chan], { match task_port.recv() { - task::Success => (), - task::Failure => { + Ok(*) => (), + Err(*) => { failure_chan.send(FailureMsg(id, subpage_id)); } } diff --git a/src/components/main/platform/common/glfw_windowing.rs b/src/components/main/platform/common/glfw_windowing.rs index 88032a221b4..023b816f892 100644 --- a/src/components/main/platform/common/glfw_windowing.rs +++ b/src/components/main/platform/common/glfw_windowing.rs @@ -30,7 +30,7 @@ impl ApplicationMethods for Application { // Per GLFW docs it's safe to set the error callback before calling // glfwInit(), and this way we notice errors from init too. do glfw::set_error_callback |_error_code, description| { - error!("GLFW error: %s", description); + error!("GLFW error: {:s}", description); }; glfw::init(); Application @@ -190,18 +190,18 @@ impl Window { match self.ready_state { Blank => { - self.glfw_window.set_title(fmt!("blank — Servo")) + self.glfw_window.set_title("blank — Servo") } Loading => { - self.glfw_window.set_title(fmt!("Loading — Servo")) + self.glfw_window.set_title("Loading — Servo") } PerformingLayout => { - self.glfw_window.set_title(fmt!("Performing Layout — Servo")) + self.glfw_window.set_title("Performing Layout — Servo") } FinishedLoading => { match self.render_state { RenderingRenderState => { - self.glfw_window.set_title(fmt!("Rendering — Servo")) + self.glfw_window.set_title("Rendering — Servo") } IdleRenderState => { self.glfw_window.set_title("Servo") diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs index 5f9c4785353..3fb0f055813 100644 --- a/src/components/main/platform/common/glut_windowing.rs +++ b/src/components/main/platform/common/glut_windowing.rs @@ -162,18 +162,18 @@ impl Window { let throbber = THROBBER[self.throbber_frame]; match self.ready_state { Blank => { - glut::set_window_title(self.glut_window, fmt!("Blank")) + glut::set_window_title(self.glut_window, "Blank") } Loading => { - glut::set_window_title(self.glut_window, fmt!("%c Loading . Servo", throbber)) + glut::set_window_title(self.glut_window, format!("{:c} Loading . Servo", throbber)) } PerformingLayout => { - glut::set_window_title(self.glut_window, fmt!("%c Performing Layout . Servo", throbber)) + glut::set_window_title(self.glut_window, format!("{:c} Performing Layout . Servo", throbber)) } FinishedLoading => { match self.render_state { RenderingRenderState => { - glut::set_window_title(self.glut_window, fmt!("%c Rendering . Servo", throbber)) + glut::set_window_title(self.glut_window, format!("{:c} Rendering . Servo", throbber)) } IdleRenderState => glut::set_window_title(self.glut_window, "Servo"), } @@ -183,7 +183,7 @@ impl Window { /// Helper function to handle keyboard events. fn handle_key(&self, key: u8) { - debug!("got key: %?", key); + debug!("got key: {}", key); let modifiers = glut::get_modifiers(); match key { 42 => self.load_url(), diff --git a/src/components/main/platform/common/shared_gl_windowing.rs b/src/components/main/platform/common/shared_gl_windowing.rs index f77dfbed362..820e8434a5f 100644 --- a/src/components/main/platform/common/shared_gl_windowing.rs +++ b/src/components/main/platform/common/shared_gl_windowing.rs @@ -33,7 +33,7 @@ impl WindowingMethods<Application> for Window { /// Creates a new window. pub fn new(_: &Application) -> @mut Window { let share_context: Context = ShareContext::new(Size2D(800, 600)); - println(fmt!("Sharing ID is %d", share_context.id())); + println(format!("Sharing ID is {:d}", share_context.id())); @mut Window(share_context) } diff --git a/src/components/main/servo.rc b/src/components/main/servo.rc index f09114c4080..268878167b0 100755 --- a/src/components/main/servo.rc +++ b/src/components/main/servo.rc @@ -11,7 +11,7 @@ #[license = "MPL"]; #[crate_type = "lib"]; -#[feature(globs, macro_rules)]; +#[feature(globs, macro_rules, managed_boxes)]; extern mod alert; extern mod azure; |