mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Check if root before establishing containing block (#36360)
As per [w3.org/TR/filter-effects-1#FilterProperty](https://www.w3.org/TR/filter-effects-1/#FilterProperty), `filter` shouldn't make the root element establish a containing block for absolute and fixed positioned descendants. `will-change: filter` has matching behavior. This PR adds a check for if we are the root element before establishing such a block. To know if we are the root element, we look at the `FragmentFlags` passed in. Previously for our function, these were dummy flags, always constructed as empty. Thus, this PR also makes sure the correct FragmentFlags are passed down the chain to the function `establishes_containing_block_for_all_descendants`. Testing: - `/css/filter-effects/filtered-html-is-not-container.html` now passes - `/css/css-will-change/will-change-fixedpos-cb-003.html` now passes - Manual tests are working Fixes: #35391 --------- Signed-off-by: haval0 <56519858+haval0@users.noreply.github.com> Signed-off-by: Oriol Brufau <obrufau@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
bab788f5d5
commit
ec88b5d752
11 changed files with 44 additions and 35 deletions
|
@ -845,9 +845,9 @@ impl ComputedValuesExt for ComputedValues {
|
|||
// > A value other than none for the filter property results in the creation of a containing
|
||||
// > block for absolute and fixed positioned descendants unless the element it applies to is
|
||||
// > a document root element in the current browsing context.
|
||||
// FIXME(#35391): Need to check if this is the root element.
|
||||
if !self.get_effects().filter.0.is_empty() ||
|
||||
will_change_bits.intersects(WillChangeBits::FIXPOS_CB_NON_SVG)
|
||||
if !fragment_flags.contains(FragmentFlags::IS_ROOT_ELEMENT) &&
|
||||
(!self.get_effects().filter.0.is_empty() ||
|
||||
will_change_bits.intersects(WillChangeBits::FIXPOS_CB_NON_SVG))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue