diff options
author | Josh Matthews <josh@joshmatthews.net> | 2020-06-02 16:50:40 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-06-09 11:27:23 -0400 |
commit | 08427ccee5e9e9d94155c1030d016ffd8ab87dd6 (patch) | |
tree | 1bd7e7d8312af3df80c224d45454378edbb6c1a1 /components/layout/flow.rs | |
parent | 4094d1632327e9b95e6a93b91b91bbb38dabbfc6 (diff) | |
download | servo-08427ccee5e9e9d94155c1030d016ffd8ab87dd6.tar.gz servo-08427ccee5e9e9d94155c1030d016ffd8ab87dd6.zip |
layout: Don't built stacking contexts or display lists for empty blocks.
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r-- | components/layout/flow.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index c2d01b7f9f9..acea20ad4d4 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -273,6 +273,22 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static { might_have_floats_in_or_out } + fn has_non_invertible_transform(&self) -> bool { + if !self.class().is_block_like() || + self.as_block() + .fragment + .style + .get_box() + .transform + .0 + .is_empty() + { + return false; + } + + self.as_block().fragment.has_non_invertible_transform() + } + fn get_overflow_in_parent_coordinates(&self) -> Overflow { // FIXME(#2795): Get the real container size. let container_size = Size2D::zero(); @@ -1160,7 +1176,9 @@ impl BaseFlow { state: &mut StackingContextCollectionState, ) { for kid in self.children.iter_mut() { - kid.collect_stacking_contexts(state); + if !kid.has_non_invertible_transform() { + kid.collect_stacking_contexts(state); + } } } |