servo/components/layout
haval0 ec88b5d752
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>
2025-04-29 19:19:31 +00:00
..
display_list layout: Account for transform in scrollable overflow (#36138) 2025-04-29 09:37:27 +00:00
flexbox layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
flow layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
fragment_tree layout: Account for transform in scrollable overflow (#36138) 2025-04-29 09:37:27 +00:00
table layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
taffy layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
tests layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
Cargo.toml layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
cell.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
construct_modern.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
context.rs Propagate image resolution errors in layout context (#36692) 2025-04-28 12:32:51 +00:00
dom.rs layout: Implement node geometry queries against BoxTree's Fragment (#36663) 2025-04-25 13:38:05 +00:00
dom_traversal.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
formatting_contexts.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
geom.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
layout_box_base.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
layout_impl.rs layout: Use box tree Fragments for offset parent queries (#36681) 2025-04-25 20:25:10 +00:00
lib.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
lists.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
positioned.rs layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
query.rs layout: Use box tree Fragments for offset parent queries (#36681) 2025-04-25 20:25:10 +00:00
quotes.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
replaced.rs Propagate image resolution errors in layout context (#36692) 2025-04-28 12:32:51 +00:00
sizing.rs layout: Combine layout_2020 and layout_thread_2020 into a crate called layout (#36613) 2025-04-19 10:17:03 +00:00
style_ext.rs layout: Check if root before establishing containing block (#36360) 2025-04-29 19:19:31 +00:00
traversal.rs layout: Structure reflow code to make it more modular (#36597) 2025-04-23 07:34:35 +00:00