layout: Refactor establishes_containing_block_for_all_descendants() (#36725)

Instead of grouping all the `will-change` conditions together, move each
one of them next to the condition for the relevant property.

This avoids the need to call `is_transformable()` multiple times, and
will also be needed for #35391.

Testing: unneeded (no change in behavior)

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-04-28 03:17:35 -07:00 committed by GitHub
parent b1d0b6a37b
commit cf41012257
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 52 additions and 30 deletions

View file

@ -530,7 +530,7 @@ impl StackingContext {
if effects.filter.0.is_empty() &&
effects.opacity == 1.0 &&
effects.mix_blend_mode == ComputedMixBlendMode::Normal &&
!style.has_transform_or_perspective(FragmentFlags::empty()) &&
!style.has_effective_transform_or_perspective(FragmentFlags::empty()) &&
style.clone_clip_path() == ClipPath::None
{
return false;
@ -1584,7 +1584,10 @@ impl BoxFragment {
&self,
containing_block_rect: &PhysicalRect<Au>,
) -> Option<ReferenceFrameData> {
if !self.style.has_transform_or_perspective(self.base.flags) {
if !self
.style
.has_effective_transform_or_perspective(self.base.flags)
{
return None;
}