Improve containing block creation for position:absolute flows

Instead of only promoting flows with positioned fragments to containing
blocks, also do this for flows which have the transform, perspective or
filter properties set. This is what the spec requires and also fixes
some failing tests. It will allow us to stop creating stacking contexts
for overflow:hidden and overflow:scroll flows.

Fixes #18091.
This commit is contained in:
Martin Robinson 2017-08-17 11:44:19 +02:00
parent 0a24c2f03c
commit 57704b0481
15 changed files with 107 additions and 43 deletions

View file

@ -407,6 +407,11 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
self.contains_positioned_fragments()
}
/// Returns true if this flow contains fragments that are roots of an absolute flow tree.
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
self.contains_relatively_positioned_fragments() || self.is_root()
}
/// Updates the inline position of a child flow during the assign-height traversal. At present,
/// this is only used for absolutely-positioned inline-blocks.
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au);
@ -502,9 +507,6 @@ pub trait ImmutableFlowUtils {
/// Returns true if this flow is one of table-related flows.
fn is_table_kind(self) -> bool;
/// Returns true if this flow contains fragments that are roots of an absolute flow tree.
fn contains_roots_of_absolute_flow_tree(&self) -> bool;
/// Returns true if this flow has no children.
fn is_leaf(self) -> bool;
@ -1198,11 +1200,6 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
}
}
/// Returns true if this flow contains fragments that are roots of an absolute flow tree.
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
self.contains_relatively_positioned_fragments() || self.is_root()
}
/// Returns true if this flow has no children.
fn is_leaf(self) -> bool {
base(self).children.is_empty()