layout: Ensure abs-pos elements establish block formatting contexts

This commit is contained in:
Paul Rouget 2019-11-14 12:14:55 +01:00
parent df9065afb6
commit 0ea9f69ca8
4 changed files with 71 additions and 0 deletions

View file

@ -1682,6 +1682,13 @@ impl BlockFlow {
/// Determines the type of formatting context this is. See the definition of
/// `FormattingContextType`.
pub fn formatting_context_type(&self) -> FormattingContextType {
if self
.base
.flags
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
{
return FormattingContextType::Other;
}
if self.is_inline_flex_item() || self.is_block_flex_item() {
return FormattingContextType::Other;
}