mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Increase BFC root height to contain floats
This commit is contained in:
parent
9829931c27
commit
e38083a96e
11 changed files with 9 additions and 22 deletions
|
@ -96,10 +96,18 @@ impl BlockFormattingContext {
|
|||
.collapsed_through
|
||||
);
|
||||
|
||||
// The content height of a BFC root should include any float participating in that BFC
|
||||
// (https://drafts.csswg.org/css2/#root-height), we implement this by imagining there is
|
||||
// an element with `clear: both` after the actual contents.
|
||||
let clearance = sequential_layout_state.map_or(Length::zero(), |sequential_layout_state| {
|
||||
sequential_layout_state.calculate_clearance(ClearSide::Both)
|
||||
});
|
||||
|
||||
IndependentLayout {
|
||||
fragments: flow_layout.fragments,
|
||||
content_block_size: flow_layout.content_block_size +
|
||||
flow_layout.collapsible_margins_in_children.end.solve(),
|
||||
flow_layout.collapsible_margins_in_children.end.solve() +
|
||||
clearance,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue