script: Use HTMLElement.scrollParent to implement Element.scrollIntoView (#39144)

To find scrolling ancestors, we need to walk up the flat tree and only
consider the elements that are in the chain of containing block
ancestors of an element. `scrollParent` now does this so we can use it
to properly implement `scrollIntoView`.

Testing: There are WPT tests for this change.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2025-09-07 14:44:11 -07:00 committed by GitHub
parent 286bbe6cb1
commit 9f4f598f44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 141 additions and 71 deletions

View file

@ -334450,6 +334450,19 @@
{}
]
],
"scrollIntoView-should-treat-slot-as-scroll-container.html": [
"a5211cc1095b82101a22300bcf4d1d233ccdf41a",
[
null,
[
[
"/css/reference/ref-filled-green-100px-square.xht",
"=="
]
],
{}
]
],
"scrollTo-zoom.html": [
"49ec49325034f9d2e10cf9b5f52add24bbcc57f6",
[