mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Don't built stacking contexts or display lists for empty blocks.
This commit is contained in:
parent
4094d16323
commit
08427ccee5
6 changed files with 50 additions and 1 deletions
|
@ -1571,6 +1571,11 @@ impl Fragment {
|
|||
return;
|
||||
}
|
||||
|
||||
// If this fragment takes up no space, we don't need to build any display items for it.
|
||||
if self.has_non_invertible_transform() {
|
||||
return;
|
||||
}
|
||||
|
||||
debug!(
|
||||
"Fragment::build_display_list at rel={:?}, abs={:?}: {:?}",
|
||||
self.border_box, stacking_relative_border_box, self
|
||||
|
@ -2376,6 +2381,11 @@ impl BlockFlow {
|
|||
state: &mut StackingContextCollectionState,
|
||||
flags: StackingContextCollectionFlags,
|
||||
) {
|
||||
// This block flow produces no stacking contexts if it takes up no space.
|
||||
if self.has_non_invertible_transform() {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut preserved_state = SavedStackingContextCollectionState::new(state);
|
||||
|
||||
let stacking_context_type = self.stacking_context_type(flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue