aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/block.rs
diff options
context:
space:
mode:
authorPaul Rouget <me@paulrouget.com>2019-11-14 12:14:55 +0100
committerPaul Rouget <me@paulrouget.com>2019-11-14 12:16:23 +0100
commit0ea9f69ca87249386151946919807ccad6fd9f2c (patch)
treef7132f5b69e37d053ee8d9986cc74b64f43eec3f /components/layout/block.rs
parentdf9065afb6e1716044855a310d1e24f05221721d (diff)
downloadservo-0ea9f69ca87249386151946919807ccad6fd9f2c.tar.gz
servo-0ea9f69ca87249386151946919807ccad6fd9f2c.zip
layout: Ensure abs-pos elements establish block formatting contexts
Diffstat (limited to 'components/layout/block.rs')
-rw-r--r--components/layout/block.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 1f4eb92ea51..80c0fae2243 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -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;
}