layout: Lay out absolutes in atomic containing blocks (#33336)

When inline atomics establish containing blocks for absolute
descendants, layout should happen with those atomics as the containing
block. This ensures that the absolute descendents have the correct
containing block and Fragment parent. This wasn't happening before and
this change fixes that.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-09-06 06:42:45 -07:00 committed by GitHub
parent ebed9218f2
commit c24c7d8e4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 19 additions and 386 deletions

View file

@ -1984,15 +1984,12 @@ impl IndependentFormattingContext {
"Mixed horizontal and vertical writing modes are not supported yet"
);
// This always collects for the nearest positioned ancestor even if the parent positioning
// context doesn't. The thing is we haven't kept track up to this point and there isn't
// any harm in keeping the hoisted boxes separate.
child_positioning_context = Some(PositioningContext::new_for_subtree(
true, /* collects_for_nearest_positioned_ancestor */
));
let mut positioning_context =
PositioningContext::new_for_style(&non_replaced.style)
.unwrap_or_else(|| PositioningContext::new_for_subtree(true));
let independent_layout = non_replaced.layout(
layout.layout_context,
child_positioning_context.as_mut().unwrap(),
&mut positioning_context,
&containing_block_for_children,
layout.containing_block,
);
@ -2022,7 +2019,7 @@ impl IndependentFormattingContext {
.to_physical_size(container_writing_mode),
);
BoxFragment::new(
let mut fragment = BoxFragment::new(
non_replaced.base_fragment_info,
non_replaced.style.clone(),
independent_layout.fragments,
@ -2033,7 +2030,18 @@ impl IndependentFormattingContext {
None,
CollapsedBlockMargins::zero(),
)
.with_baselines(independent_layout.baselines)
.with_baselines(independent_layout.baselines);
if fragment
.style
.establishes_containing_block_for_absolute_descendants(fragment.base.flags)
{
positioning_context
.layout_collected_children(layout.layout_context, &mut fragment);
}
child_positioning_context = Some(positioning_context);
fragment
},
};

View file

@ -1,2 +0,0 @@
[abspos-inline-007.xht]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -20,9 +20,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 9]
expected: FAIL
@ -43,6 +40,3 @@
[.item 15]
expected: FAIL
[.item 16]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -26,9 +26,6 @@
[.item 9]
expected: FAIL
[.item 10]
expected: FAIL
[.item 11]
expected: FAIL
@ -55,6 +52,3 @@
[.item 19]
expected: FAIL
[.item 20]
expected: FAIL

View file

@ -8,9 +8,6 @@
[.item 3]
expected: FAIL
[.item 4]
expected: FAIL
[.item 5]
expected: FAIL
@ -20,9 +17,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 10]
expected: FAIL

View file

@ -8,9 +8,6 @@
[.item 3]
expected: FAIL
[.item 4]
expected: FAIL
[.item 5]
expected: FAIL
@ -20,9 +17,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 10]
expected: FAIL

View file

@ -8,9 +8,6 @@
[.item 3]
expected: FAIL
[.item 4]
expected: FAIL
[.item 5]
expected: FAIL
@ -20,9 +17,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 10]
expected: FAIL

View file

@ -8,9 +8,6 @@
[.item 3]
expected: FAIL
[.item 4]
expected: FAIL
[.item 5]
expected: FAIL
@ -20,9 +17,6 @@
[.item 7]
expected: FAIL
[.item 8]
expected: FAIL
[.item 10]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-left-width-medium.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-left-width-thick.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-left-width-thin.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-right-width-medium.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-right-width-thick.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-right-width-thin.html]
expected: FAIL

View file

@ -1,71 +1,11 @@
[position-absolute-replaced-minmax.html]
expected: TIMEOUT
[minmax replaced IFRAME 1]
expected: FAIL
[minmax replaced IFRAME 2]
expected: FAIL
[minmax replaced IFRAME 3]
expected: FAIL
[minmax replaced IFRAME 4]
expected: FAIL
[minmax replaced IFRAME 5]
expected: FAIL
[minmax replaced IFRAME 6]
expected: FAIL
[minmax replaced IFRAME 7]
expected: FAIL
[minmax replaced IFRAME 8]
expected: FAIL
[minmax replaced IFRAME 9]
expected: FAIL
[minmax replaced IFRAME 10]
expected: FAIL
[minmax replaced IFRAME 11]
expected: FAIL
[minmax replaced IMG 12]
expected: FAIL
[minmax replaced IMG 13]
expected: FAIL
[minmax replaced IMG 14]
expected: FAIL
[minmax replaced IMG 15]
expected: FAIL
[minmax replaced IMG 16]
expected: FAIL
[minmax replaced IMG 17]
expected: FAIL
[minmax replaced IMG 18]
expected: FAIL
[minmax replaced IMG 19]
expected: FAIL
[minmax replaced IMG 20]
expected: FAIL
[minmax replaced IMG 21]
expected: FAIL
[minmax replaced IMG 22]
expected: FAIL
[minmax replaced IMG svg 23]
expected: NOTRUN

View file

@ -77,69 +77,6 @@
[Web Animations: property <left> from [0px\] to [calc(infinity * 1px)\] at (1.25) should be [33554400px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (-0.25) should be [-10px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0) should be [0px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.25) should be [10px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.5) should be [20px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.75) should be [30px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1) should be [40px\]]
expected: FAIL
[CSS Transitions: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1.25) should be [50px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (-0.25) should be [-10px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0) should be [0px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.25) should be [10px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.5) should be [20px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.75) should be [30px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1) should be [40px\]]
expected: FAIL
[CSS Transitions with transition: all: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1.25) should be [50px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (-0.25) should be [-10px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0) should be [0px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.25) should be [10px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.5) should be [20px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (0.75) should be [30px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1) should be [40px\]]
expected: FAIL
[CSS Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (1.25) should be [50px\]]
expected: FAIL
[Web Animations: property <left> from [calc(50% - 25px)\] to [calc(100% - 10px)\] at (-0.25) should be [-10px\]]
expected: FAIL

View file

@ -0,0 +1,2 @@
[backdrop-filter-boundary.html]
expected: FAIL