Do not hoist floated fragments

Instead of hoisting floated fragments to be siblings of the fragment
created by their containing block formatting context, keep them in
"normal" fragment tree position and adjust their positioning to be
relative to the containing block. This means that float fragments follow
the existing invariants of the fragment tree and properly handle hit
testing, painting order, and relative positioning.

The tradeoff here is more complexity tracking the containing block
offsets from the block formatting context (including handling collapsed
margins), but less complexity dealing with hoisting / shared ownership
in addition to the correctness benefits.

Some tests are failing now because this change revealed some additional
shortcomings with clearing block formatting context content size past
the end of their contained floats. This will be fixed in a followup
change.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2023-05-25 13:12:22 +02:00 committed by Oriol Brufau
parent cdec48328e
commit 25f6cc04a2
22 changed files with 250 additions and 296 deletions

View file

@ -0,0 +1,2 @@
[clear-on-child-with-margins-2.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[remove-block-before-self-collapsing-sibling-with-clearance.html]
expected: FAIL

View file

@ -8,18 +8,6 @@
[CSS Transitions with transition: all: property <float> from [initial\] to [right\] at (0.3) should be [right\]]
expected: FAIL
[CSS Animations: property <float> from [initial\] to [right\] at (0.5) should be [right\]]
expected: FAIL
[CSS Animations: property <float> from [initial\] to [right\] at (0.6) should be [right\]]
expected: FAIL
[CSS Animations: property <float> from [initial\] to [right\] at (1) should be [right\]]
expected: FAIL
[CSS Animations: property <float> from [initial\] to [right\] at (1.5) should be [right\]]
expected: FAIL
[Web Animations: property <float> from [initial\] to [right\] at (-0.3) should be [initial\]]
expected: FAIL

View file

@ -1,2 +1,2 @@
[float-root.html]
expected: TIMEOUT
expected: FAIL

View file

@ -1,2 +0,0 @@
[float-under-flatten-under-preserve-3d.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-001.html]
[hit-test-floats-001]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -1,3 +0,0 @@
[hit-test-floats-005.html]
[Miss clipped float]
expected: FAIL

View file

@ -1,2 +0,0 @@
[new-fc-beside-adjoining-float.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[new-fc-separates-from-float.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[block-in-inline-hittest-float-001.html]
[block-in-inline-hittest-float-001]
expected: FAIL

View file

@ -1,15 +0,0 @@
[block-in-inline-hittest-float-002.html]
[block-in-inline-hittest-float-002]
expected: FAIL
[with background]
expected: FAIL
[with padding]
expected: FAIL
[floats before block-in-inline]
expected: FAIL
[floats before block-in-inline with background]
expected: FAIL