layout: Disallow margins from collapsing through block formatting

contexts per CSS 2.1 § 8.3.1.

Closes #10449.
This commit is contained in:
Patrick Walton 2016-04-07 10:47:31 -07:00
parent a3fd226341
commit f69931552b
5 changed files with 84 additions and 4 deletions

View file

@ -1751,7 +1751,7 @@ impl Flow for BlockFlow {
self.base.position.size.block = self.fragment.border_box.size.block;
}
None
} else if self.is_root() || self.base.flags.is_float() || self.is_inline_block() {
} else if self.is_root() || self.formatting_context_type() != FormattingContextType::None {
// Root element margins should never be collapsed according to CSS § 8.3.1.
debug!("assign_block_size: assigning block_size for root flow {:?}",
flow::base(self).debug_id());