Fix containing block size for absolute root element

Fixes #16248.
This commit is contained in:
Matt Brubeck 2017-05-15 14:19:19 -07:00
parent f87e362059
commit e34cf4fba0
4 changed files with 56 additions and 1 deletions

View file

@ -657,7 +657,7 @@ impl BlockFlow {
pub fn containing_block_size(&self, viewport_size: &Size2D<Au>, descendant: OpaqueFlow)
-> LogicalSize<Au> {
debug_assert!(self.base.flags.contains(IS_ABSOLUTELY_POSITIONED));
if self.is_fixed() {
if self.is_fixed() || self.is_root() {
// Initial containing block is the CB for the root
LogicalSize::from_physical(self.base.writing_mode, *viewport_size)
} else {