From badf1b85730bab0d7508256c8ca767c6701c01a7 Mon Sep 17 00:00:00 2001 From: Eric Atkinson Date: Tue, 4 Jun 2013 12:33:35 -0700 Subject: [PATCH] Vertical margins now contribute to content height. --- src/components/main/layout/block.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/main/layout/block.rs b/src/components/main/layout/block.rs index 6bc5e0159a2..e2903d2af00 100644 --- a/src/components/main/layout/block.rs +++ b/src/components/main/layout/block.rs @@ -265,20 +265,22 @@ impl BlockFlowData { cur_y - top_offset }; - let mut pb = Au(0); + let mut noncontent_height = Au(0); self.box.map(|&box| { do box.with_mut_base |base| { //The associated box is the border box of this flow base.position.origin.y = base.model.margin.top; - pb = base.model.padding.top + base.model.padding.bottom + + noncontent_height = base.model.padding.top + base.model.padding.bottom + base.model.border.top + base.model.border.bottom; - base.position.size.height = height + pb; + base.position.size.height = height + noncontent_height; + + noncontent_height += base.model.margin.top + base.model.margin.bottom; } }); //TODO(eatkinson): compute heights using the 'height' property. - self.common.position.size.height = height + pb; + self.common.position.size.height = height + noncontent_height; }