Skip to content

Commit

Permalink
Vertical margins now contribute to content height.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Atkinson authored and pcwalton committed Jun 12, 2013
1 parent 4017839 commit badf1b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/main/layout/block.rs
Expand Up @@ -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;

}

Expand Down

0 comments on commit badf1b8

Please sign in to comment.