layout: Use box tree Fragments for offset parent queries (#36681)

This change switches `offsetParent`, `offsetLeft`, etc queries to use
the BoxTree fragments instead of walking the entire fragment tree. In
addition, fragments are stored for columns and colgroups. In general,
this greatly simplifies the flow of the query and prevents having to do
expensive tree walks.

Testing: This change is covered by newly passing WPT tests and three new
failures:

 - /css/filter-effects/backdrop-filter-edge-clipping-2.html
 - /css/filter-effects/backdrop-filter-edge-mirror.html
 - /css/filter-effects/backdrop-filter-edge-pixels-2.html

These failures are actually progressions, because now the references
start
to render properly whereas before they did not.

Fixes: This is part of #36525 and #36665.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-25 22:25:10 +02:00 committed by GitHub
parent 69605d05cf
commit a62f0eaf0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 193 additions and 269 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -1,24 +0,0 @@
[offsetParent-across-shadow-boundaries.html]
[offsetParent must skip offset parents of an element when the context object is assigned to a slot in a shadow tree of open mode]
expected: FAIL
[offsetParent must skip offset parents of an element when the context object is assigned to a slot in a shadow tree of closed mode]
expected: FAIL
[offsetParent must skip multiple offset parents of an element when the context object is assigned to a slot in a shadow tree of open mode]
expected: FAIL
[offsetParent must skip multiple offset parents of an element when the context object is assigned to a slot in a shadow tree of closed mode]
expected: FAIL
[offsetParent must skip offset parents of an element when the context object is assigned to a slot in nested shadow trees of open mode]
expected: FAIL
[offsetParent must skip offset parents of an element when the context object is assigned to a slot in nested shadow trees of closed mode]
expected: FAIL
[offsetParent must find the first offset parent which is a shadow-including ancestor of the context object even some shadow tree of open mode did not have any offset parent]
expected: FAIL
[offsetParent must find the first offset parent which is a shadow-including ancestor of the context object even some shadow tree of closed mode did not have any offset parent]
expected: FAIL

View file

@ -4,6 +4,3 @@
[Verifies that HTMLElement.offsetTop accounts for shadow boundaries when nested in multiple shadow roots.]
expected: FAIL
[Verifies that HTMLElement.offsetLeft accounts for shadow boundaries.]
expected: FAIL