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
|
@ -1774,7 +1774,9 @@ impl FlexItem<'_> {
|
|||
non_stretch_layout_result: Option<&mut FlexItemLayoutResult>,
|
||||
) -> Option<FlexItemLayoutResult> {
|
||||
let containing_block = flex_context.containing_block;
|
||||
let mut positioning_context = PositioningContext::new_for_style(self.box_.style())
|
||||
let independent_formatting_context = &self.box_.independent_formatting_context;
|
||||
let mut positioning_context = independent_formatting_context
|
||||
.new_positioning_context()
|
||||
.unwrap_or_else(|| {
|
||||
PositioningContext::new_for_subtree(
|
||||
flex_context
|
||||
|
@ -1783,7 +1785,6 @@ impl FlexItem<'_> {
|
|||
)
|
||||
});
|
||||
|
||||
let independent_formatting_context = &self.box_.independent_formatting_context;
|
||||
let item_writing_mode = independent_formatting_context.style().writing_mode;
|
||||
let item_is_horizontal = item_writing_mode.is_horizontal();
|
||||
let flex_axis = flex_context.config.flex_axis;
|
||||
|
@ -2616,7 +2617,9 @@ impl FlexItemBox {
|
|||
cross_size_stretches_to_container_size: bool,
|
||||
intrinsic_sizing_mode: IntrinsicSizingMode,
|
||||
) -> Au {
|
||||
let mut positioning_context = PositioningContext::new_for_style(self.style())
|
||||
let mut positioning_context = self
|
||||
.independent_formatting_context
|
||||
.new_positioning_context()
|
||||
.unwrap_or_else(|| {
|
||||
PositioningContext::new_for_subtree(
|
||||
flex_context
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue