aboutsummaryrefslogtreecommitdiffstats
path: root/src/servo/layout/root.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-05-07 20:52:38 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-05-08 15:20:13 -0700
commitb17e68ee048756bf2ca5a43f26204059a5f48f32 (patch)
treebfcfa5ed95b5493ea3c3120b3a6b5f68d31e1a5c /src/servo/layout/root.rs
parent49edf85f5d98ea44198c24befa02bebada8fdad4 (diff)
downloadservo-b17e68ee048756bf2ca5a43f26204059a5f48f32.tar.gz
servo-b17e68ee048756bf2ca5a43f26204059a5f48f32.zip
layout: Refactor the RenderBox type to save memory and improve the coding style of box.rs
Diffstat (limited to 'src/servo/layout/root.rs')
-rw-r--r--src/servo/layout/root.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/servo/layout/root.rs b/src/servo/layout/root.rs
index a67eb0b6b1c..1e33894621d 100644
--- a/src/servo/layout/root.rs
+++ b/src/servo/layout/root.rs
@@ -20,7 +20,7 @@ pub struct RootFlowData {
common: FlowData,
/// The render box at the root of the tree.
- box: Option<@mut RenderBox>
+ box: Option<RenderBox>
}
impl RootFlowData {
@@ -73,9 +73,11 @@ impl RootFlowData {
self.common.position.size.height = Au::max(ctx.screen_size.size.height, cur_y);
do RootFlow(self).with_block_box |box| {
- box.d().position.origin.y = Au(0);
- box.d().position.size.height = Au::max(ctx.screen_size.size.height, cur_y);
- let (_used_top, _used_bot) = box.get_used_height();
+ do box.with_mut_base |base| {
+ base.position.origin.y = Au(0);
+ base.position.size.height = Au::max(ctx.screen_size.size.height, cur_y);
+ let (_used_top, _used_bot) = box.get_used_height();
+ }
}
}