diff --git a/src/components/main/layout/block.rs b/src/components/main/layout/block.rs index 1d0ec0f9d86..ac980be4bb6 100644 --- a/src/components/main/layout/block.rs +++ b/src/components/main/layout/block.rs @@ -10,12 +10,12 @@ use layout::display_list_builder::{DisplayListBuilder, FlowDisplayListBuilderMet use layout::flow::{BlockFlow, FlowContext, FlowData, InlineBlockFlow}; use layout::inline::InlineLayout; -use au = gfx::geometry; use core::cell::Cell; use geom::point::Point2D; use geom::rect::Rect; use gfx::display_list::DisplayList; use gfx::geometry::Au; +use gfx::geometry; use servo_util::tree::{TreeNodeRef, TreeUtils}; pub struct BlockFlowData { @@ -95,8 +95,8 @@ impl BlockFlowData { assert!(child_ctx.starts_block_flow() || child_ctx.starts_inline_flow()); do child_ctx.with_base |child_node| { - min_width = au::max(min_width, child_node.min_width); - pref_width = au::max(pref_width, child_node.pref_width); + min_width = geometry::max(min_width, child_node.min_width); + pref_width = geometry::max(pref_width, child_node.pref_width); } } @@ -155,8 +155,11 @@ impl BlockFlowData { } } - let height = if self.is_root { Au::max(ctx.screen_size.size.height, cur_y) } - else { cur_y }; + let height = if self.is_root { + Au::max(ctx.screen_size.size.height, cur_y) + } else { + cur_y + }; self.common.position.size.height = height; diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index fc5d2bacc25..a45d46e6df8 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -13,10 +13,6 @@ use layout::context::LayoutContext; use layout::display_list_builder::{DisplayListBuilder, FlowDisplayListBuilderMethods}; use layout::flow::FlowContext; use util::task::spawn_listener; -use servo_util::time; -use servo_util::time::time; -use servo_util::time::profile; -use servo_util::time::ProfilerChan; use core::cast::transmute; use core::cell::Cell; @@ -42,7 +38,9 @@ use script::layout_interface::{MatchSelectorsDamage, Msg, NoDamage, QueryMsg, Re use script::script_task::{ScriptMsg, SendEventMsg}; use servo_net::image_cache_task::{ImageCacheTask, ImageResponseMsg}; use servo_net::local_image_cache::LocalImageCache; -use servo_util::tree::TreeUtils; +use servo_util::tree::{TreeNodeRef, TreeUtils}; +use servo_util::time::{ProfilerChan, profile, time}; +use servo_util::time; pub fn create_layout_task(render_task: RenderTask, img_cache_task: ImageCacheTask, @@ -222,9 +220,13 @@ impl Layout { // TODO: Be smarter about what needs painting. layout_root.build_display_list(&builder, &layout_root.position(), display_list); + let root_size = do layout_root.with_base |base| { + base.position.size + }; + let render_layer = RenderLayer { display_list: display_list.take(), - size: Size2D(screen_size.width.to_px() as uint, screen_size.height.to_px() as uint) + size: Size2D(root_size.width.to_px() as uint, root_size.height.to_px() as uint) }; self.render_task.channel.send(RenderMsg(render_layer));