Implement document.scrollingElement (#35994)

<!-- Please describe your changes on the following line: -->
This implements `document.scrollingElement`
(https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #35700
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

---------

Signed-off-by: JimmyDdotEXE <50691404+JimmyDdotEXE@users.noreply.github.com>
This commit is contained in:
Jimmy D. Buckets 2025-05-05 08:50:42 -04:00 committed by GitHub
parent 7ea5951e34
commit 1f6050f931
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 195 additions and 272 deletions

View file

@ -1,13 +1,4 @@
[HTMLBody-ScrollArea_quirksmode.html]
[document.scrollingElement should be body element in quirks.]
expected: FAIL
[scrollingElement in quirks should be null when body is potentially scrollable.]
expected: FAIL
[scrollingElement in quirks should be body if any of document and body has a visible overflow.]
expected: FAIL
[When body potentially scrollable, document.body.scrollHeight changes when changing the height of the body content in quirks.]
expected: FAIL

View file

@ -38,9 +38,6 @@
[Window interface: window must inherit property "screenTop" with the proper type]
expected: FAIL
[Document interface: attribute scrollingElement]
expected: FAIL
[CSSPseudoElement interface: operation convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)]
expected: FAIL
@ -107,9 +104,6 @@
[Document interface: document must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type]
expected: FAIL
[Document interface: document must inherit property "scrollingElement" with the proper type]
expected: FAIL
[CaretPosition interface object name]
expected: FAIL

View file

@ -1,13 +1,4 @@
[scroll-behavior-main-frame-root.html]
[Main frame with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -17,21 +8,9 @@
[Main frame with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -41,21 +20,9 @@
[Main frame with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -65,9 +32,6 @@
[Main frame with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -95,23 +59,11 @@
[Main frame with smooth scroll-behavior ; scrollIntoView() with smooth behavior]
expected: FAIL
[Set scrollLeft to frame with auto scroll-behavior]
expected: FAIL
[Set scrollLeft to frame with smooth scroll-behavior]
expected: FAIL
[Set scrollTop to frame with auto scroll-behavior]
expected: FAIL
[Set scrollTop to frame with smooth scroll-behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with an instant scrolling]
expected: FAIL
[Make sure the page is ready for animation.]
expected: FAIL

View file

@ -1,13 +1,4 @@
[scroll-behavior-main-frame-window.html]
[Main frame with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -17,21 +8,9 @@
[Main frame with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -41,21 +20,9 @@
[Main frame with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -65,17 +32,8 @@
[Main frame with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with an instant scrolling]
expected: FAIL
[Make sure the page is ready for animation.]
expected: FAIL

View file

@ -1,13 +1,4 @@
[scroll-behavior-subframe-root.html]
[Subframe with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -17,21 +8,9 @@
[Subframe with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -41,21 +20,9 @@
[Subframe with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Subframe with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -65,9 +32,6 @@
[Subframe with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Subframe with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -95,23 +59,11 @@
[Subframe with smooth scroll-behavior ; scrollIntoView() with smooth behavior]
expected: FAIL
[Subframe setting scrollLeft with auto scroll-behavior]
expected: FAIL
[Subframe setting scrollLeft with smooth scroll-behavior]
expected: FAIL
[Subframe setting scrollTop with auto scroll-behavior]
expected: FAIL
[Subframe setting scrollTop with smooth scroll-behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on a subframe with another smooth scrolling]
expected: FAIL
[Aborting an ongoing smooth scrolling on a subframe with an instant scrolling]
expected: FAIL
[Make sure the page is ready for animation.]
expected: FAIL

View file

@ -1,13 +1,4 @@
[scroll-behavior-subframe-window.html]
[Main frame with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -17,21 +8,9 @@
[Main frame with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -41,21 +20,9 @@
[Main frame with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -65,17 +32,8 @@
[Main frame with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Main frame with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with another smooth scrolling]
expected: FAIL
[Aborting an ongoing smooth scrolling on the main frame with an instant scrolling]
expected: FAIL
[Make sure the page is ready for animation.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[scroll-overflow-clip-quirks-001.html]
[CSSOM scrollingElement reflects the propagated scroll to viewport correctly]
expected: FAIL

View file

@ -1,4 +0,0 @@
[scroll-overflow-clip-quirks-002.html]
[CSSOM scrollingElement reflects the propagated scroll to viewport correctly]
expected: FAIL

View file

@ -1,22 +1,10 @@
[scrolling-quirks-vs-nonquirks.html]
[scrollingElement in non-quirks mode]
expected: FAIL
[scrollLeft/scrollRight of the content in quirks mode]
expected: FAIL
[scrollWidth/scrollHeight on the root element in non-quirks mode]
expected: FAIL
[scrollingElement in quirks mode]
expected: FAIL
[scrollWidth/scrollHeight on the root element in quirks mode]
expected: FAIL
[scrollLeft/scrollRight of the content in non-quirks mode]
expected: FAIL
[scrollWidth/scrollHeight on the HTML body element in quirks mode]
expected: FAIL

View file

@ -1,28 +0,0 @@
[scrollingElement.html]
[scrollingElement in quirks mode]
expected: FAIL
[scrollingElement in no-quirks mode]
expected: FAIL
[scrollingElement in quirks mode (body table)]
expected: FAIL
[scrollingElement in no-quirks mode ]
expected: FAIL
[scrollingElement in no-quirks mode (root table)]
expected: FAIL
[scrollingElement in no-quirks mode (body table)]
expected: FAIL
[scrollingElement in quirks mode (root table, body table)]
expected: FAIL
[scrollingElement in quirks mode (root table)]
expected: FAIL
[scrollingElement in no-quirks mode (root table, body table)]
expected: FAIL