layout: Take sticky offsets into account for offset queries (#39385)

`offsetLeft` and `offsetTop` were ignoring that sticky positioned boxes
can be shifted out of their normal position.

Testing: Various test improvements.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2025-09-19 16:20:15 +02:00 committed by GitHub
parent 754c938722
commit 2c3d580ef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 69 additions and 118 deletions

View file

@ -1,6 +0,0 @@
[position-sticky-bottom.html]
[after reaching the sticking point the sticky box should be offset]
expected: FAIL
[the sticky box should not be pushed outside its containing block]
expected: FAIL

View file

@ -1,2 +0,0 @@
[position-sticky-change-top.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[position-sticky-flexbox.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[position-sticky-inflow-position.html]
[sticky offset should not affect the position of other elements.]
expected: FAIL

View file

@ -1,6 +0,0 @@
[position-sticky-left.html]
[after reaching the sticking point the sticky box should be offset]
expected: FAIL
[the sticky box should not be pushed outside its containing block]
expected: FAIL

View file

@ -1,6 +1,3 @@
[position-sticky-margins.html]
[Whilst stuck, the margin is irrelevant.]
expected: FAIL
[The margin is taken into account when making sure the sticky element does not escape its container]
expected: FAIL

View file

@ -1,9 +0,0 @@
[position-sticky-nested-bottom.html]
[both sticky boxes can be stuck at the same time]
expected: FAIL
[neither sticky can escape their containing block]
expected: FAIL
[the inner sticky cannot be pushed outside the outer sticky]
expected: FAIL

View file

@ -1,12 +0,0 @@
[position-sticky-nested-left.html]
[the inner sticky can stick before the outer one if necessary]
expected: FAIL
[both sticky boxes can be stuck at the same time]
expected: FAIL
[neither sticky can escape their containing block]
expected: FAIL
[the inner sticky cannot be pushed outside the outer sticky]
expected: FAIL

View file

@ -1,9 +0,0 @@
[position-sticky-nested-right.html]
[both sticky boxes can be stuck at the same time]
expected: FAIL
[neither sticky can escape their containing block]
expected: FAIL
[the inner sticky cannot be pushed outside the outer sticky]
expected: FAIL

View file

@ -1,12 +0,0 @@
[position-sticky-nested-top.html]
[the inner sticky can stick before the outer one if necessary]
expected: FAIL
[both sticky boxes can be stuck at the same time]
expected: FAIL
[neither sticky can escape their containing block]
expected: FAIL
[the inner sticky cannot be pushed outside the outer sticky]
expected: FAIL

View file

@ -1,3 +0,0 @@
[position-sticky-offset-overflow.html]
[sticky position offset should be contained by scrolling box]
expected: FAIL

View file

@ -1,2 +0,0 @@
[position-sticky-rendering.html]
expected: FAIL

View file

@ -1,6 +0,0 @@
[position-sticky-right.html]
[after reaching the sticking point the sticky box should be offset]
expected: FAIL
[the sticky box should not be pushed outside its containing block]
expected: FAIL

View file

@ -1,3 +0,0 @@
[position-sticky-root-scroller.html]
[Sticky elements work with the root (document) scroller]
expected: FAIL

View file

@ -1,6 +0,0 @@
[position-sticky-top-and-bottom.html]
[initially the sticky box should be pushed to the top of the container]
expected: FAIL
[when we scroll past the flow position the top constraint pushes it down]
expected: FAIL

View file

@ -1,6 +0,0 @@
[position-sticky-top.html]
[after reaching the sticking point the sticky box should be offset]
expected: FAIL
[the sticky box should not be pushed outside its containing block]
expected: FAIL

View file

@ -1,4 +0,0 @@
[position-sticky-root-scroller-with-scroll-behavior.html]
[Sticky elements work with the root (document) scroller]
expected: FAIL