Auto merge of #29661 - mrobinson:several-scrolling-fixes, r=mukilan

Fix various issues with scrolling

This change fixes three issues with scrolling:

 - In order for scrolls from script to properly scroll nodes in WebRender that might require a layout, Servo should first flush layout and send the display list to WebRender.
 - `overflow: scroll` elements were not scrollable from script. This change also refactors the detection of a potentially scrollable body in quirks mode in order to make it match the specification more closely.
- Enable script scrolls in Layout 2020 by adding an implementation of the scroll area query, which is necessary to ensure that an element does support scrolling.

Each of these changes is a separate commit here with corresponding test expectation updates.

Fixes #29659.
Fixes servo/webrender#3078.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #29659 and servo/webrender#3078.
- [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. -->
This commit is contained in:
bors-servo 2023-04-25 22:55:57 +02:00 committed by GitHub
commit e4d08358ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 202 additions and 508 deletions

View file

@ -1,2 +0,0 @@
[attachment-local-positioning-2.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[attachment-scroll-positioning-1.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[scroll-positioned-multiple-background-images.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[containing-block-change-scrollframe.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[position-absolute-under-non-containing-stacking-context.html]
expected: FAIL

View file

@ -11,12 +11,6 @@
[.containing-block 4]
expected: FAIL
[.containing-block 5]
expected: FAIL
[.containing-block 6]
expected: FAIL
[.containing-block 7]
expected: FAIL
@ -32,11 +26,5 @@
[.containing-block 11]
expected: FAIL
[.containing-block 12]
expected: FAIL
[.containing-block 13]
expected: FAIL
[.containing-block 14]
expected: FAIL

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,3 @@
[position-sticky-overflow-padding.html]
[A sticky element should be offset by ancestor padding even when stuck]
expected: FAIL
[Ancestor overflow padding does not allow a sticky element to escape its container]
expected: FAIL

View file

@ -1,6 +0,0 @@
[position-sticky-scrolled-remove-sibling.html]
[Sticky position and its overflow contribution in the vertical axis]
expected: FAIL
[Sticky position and its overflow contribution in the horizontal axis]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[z-index-blend-will-change-overlapping-layers.html]
expected: FAIL

View file

@ -1,3 +1,9 @@
[MediaQueryList-addListener-removeListener.html]
[listeners are called when <iframe> is resized]
expected: FAIL
[listeners are called correct number of times]
expected: FAIL
[listeners are called in order their MQLs were created]
expected: FAIL

View file

@ -1,2 +0,0 @@
[add-background-attachment-fixed-during-smooth-scroll.html]
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[background-change-during-smooth-scroll.html]
expected: TIMEOUT
[background change during smooth scroll]
expected: NOTRUN

View file

@ -1,6 +0,0 @@
[dom-element-scroll.html]
[Element test for having overflow]
expected: FAIL
[Element test for having scrolling box]
expected: FAIL

View file

@ -1,3 +0,0 @@
[elementFromPoint-float-in-table.html]
[float-in-div]
expected: FAIL

View file

@ -1,12 +0,0 @@
[elementScroll-002.html]
[simple scroll with style: 'padding' and 'overflow: hidden']
expected: FAIL
[simple scroll with style: 'margin' and 'overflow: hidden']
expected: FAIL
[simple scroll with style: 'margin' and 'overflow: scroll']
expected: FAIL
[simple scroll with style: 'padding' and 'overflow: scroll']
expected: FAIL

View file

@ -1,24 +1,3 @@
[elementScroll.html]
[Element scrollTop/Left getter/setter test]
expected: FAIL
[Element scrollBy test (two arguments)]
expected: FAIL
[Element scrollTo test (two arguments)]
expected: FAIL
[Element scroll test (two arguments)]
expected: FAIL
[Element scroll maximum test]
expected: FAIL
[Element scrollTo test (one argument)]
expected: FAIL
[Element scrollBy test (one argument)]
expected: FAIL
[Element scroll test (one argument)]
expected: FAIL

View file

@ -1,6 +1,3 @@
[elementsFromPoint-iframes.html]
[elementsFromPoint on the root document for points in iframe elements]
expected: FAIL
[elementsFromPoint on inner documents]
expected: FAIL

View file

@ -1,4 +0,0 @@
[elementsFromPoint-inline-vlr-ltr.html]
[elementsFromPoint should return all elements under a point]
expected: FAIL

View file

@ -1,3 +0,0 @@
[pt-to-px-width.html]
[10pt converted to offset/client/scroll width]
expected: FAIL

View file

@ -1,6 +1,3 @@
[scroll-behavior-default-css.html]
[Instant scrolling of an element with default scroll-behavior]
expected: FAIL
[Smooth scrolling of an element with default scroll-behavior]
expected: FAIL

View file

@ -1,13 +1,4 @@
[scroll-behavior-element.html]
[Element with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -17,21 +8,9 @@
[Element with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -41,21 +20,9 @@
[Element with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -65,9 +32,6 @@
[Element with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -95,17 +59,8 @@
[Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior]
expected: FAIL
[Set scrollLeft to element with auto scroll-behavior]
expected: FAIL
[Set scrollLeft to element with smooth scroll-behavior]
expected: FAIL
[Set scrollTop to element with auto scroll-behavior]
expected: FAIL
[Set scrollTop to element with smooth scroll-behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on an element with another smooth scrolling]
expected: FAIL

View file

@ -5,63 +5,8 @@
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when aborting a smooth scrolling with an instant scrolling]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 500 to 250 by setting scrollTop ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when aborting a smooth scrolling with another smooth scrolling]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 1000 to 500 by setting scrollLeft ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 0 to 500 by setting scrollLeft ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 0 to 250 by setting scrollTop ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollBy() ]
expected: FAIL

View file

@ -13,15 +13,3 @@
[elemOverflow.scrollHeight is the width of its scrolled contents (including padding)]
expected: FAIL
[elemSimple.scrollHeight is its clientHeight]
expected: FAIL
[elemSimple.scrollWidth is its clientWidth]
expected: FAIL
[elemNestedOverflow.scrollHeight is the height of its scrolled contents (ignoring padding)]
expected: FAIL
[elemNestedOverflow.scrollWidth is the width of its scrolled contents (ignoring padding)]
expected: FAIL

View file

@ -1,18 +0,0 @@
[scrollWidthHeightWhenNotScrollable.xht]
[elemSimple.scrollWidth is its clientWidth]
expected: FAIL
[elemSimple.scrollHeight is its clientHeight]
expected: FAIL
[elemOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)]
expected: FAIL
[elemNestedOverflow.scrollWidth is the width of its scrolled contents (ignoring padding, since we overflowed)]
expected: FAIL
[elemNestedOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)]
expected: FAIL
[elemOverflow.scrollHeight is the width of its scrolled contents (ignoring padding, since we overflowed)]
expected: FAIL

View file

@ -8,24 +8,15 @@
[scrollBy() on the root element in non-quirks mode]
expected: FAIL
[scrollWidth/scrollHeight of the content in non-quirks mode]
expected: FAIL
[scrollLeft/scrollRight of the content in quirks mode]
expected: FAIL
[scrollWidth/scrollHeight 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 HTML body element in non-quirks mode]
expected: FAIL
[clientWidth/clientHeight on the root element in non-quirks mode]
expected: FAIL
@ -43,3 +34,21 @@
[scrollWidth/scrollHeight on the HTML body element in quirks mode]
expected: FAIL
[scroll() on the HTML body element in non-quirks mode]
expected: FAIL
[scrollBy() on the HTML body element in non-quirks mode]
expected: FAIL
[scrollLeft/scrollTop on the HTML body element in non-quirks mode]
expected: FAIL
[scroll() on the HTML body element in quirks mode]
expected: FAIL
[scrollBy() on the HTML body element in quirks mode]
expected: FAIL
[scrollLeft/scrollTop on the HTML body element in quirks mode]
expected: FAIL

View file

@ -1,3 +0,0 @@
[clear-on-parent-and-child.html]
bug: https://github.com/servo/webrender/issues/3078
expected: FAIL

View file

@ -1,3 +0,0 @@
[attachment-local-positioning-2.html]
bug: https://github.com/servo/webrender/issues/3078
expected: FAIL

View file

@ -1,3 +0,0 @@
[attachment-scroll-positioning-1.html]
bug: https://github.com/servo/webrender/issues/3078
expected: FAIL

View file

@ -1,3 +0,0 @@
[scroll-positioned-multiple-background-images.html]
bug: https://github.com/servo/webrender/issues/3078
expected: FAIL

View file

@ -1,2 +0,0 @@
[containing-block-change-scrollframe.html]
expected: FAIL

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,2 +0,0 @@
[z-index-blend-will-change-overlapping-layers.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[text-overflow-021.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[CaretPosition-001.html]
[Element at (400, 100)]
expected: FAIL

View file

@ -1,2 +0,0 @@
[add-background-attachment-fixed-during-smooth-scroll.html]
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[background-change-during-smooth-scroll.html]
expected: TIMEOUT
[background change during smooth scroll]
expected: NOTRUN

View file

@ -1,7 +1,3 @@
[elementScroll-002.html]
[simple scroll with style: 'margin' and 'overflow: scroll']
expected: FAIL
[simple scroll with style: 'padding' and 'overflow: scroll']
expected: FAIL

View file

@ -2,8 +2,5 @@
[Testing default value of scroll-behavior]
expected: FAIL
[Instant scrolling of an element with default scroll-behavior]
expected: FAIL
[Smooth scrolling of an element with default scroll-behavior]
expected: FAIL

View file

@ -2,15 +2,6 @@
[Testing scrollOptions' behavior for Element.scroll* and scroll-behavior on an element]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
@ -20,21 +11,9 @@
[Element with smooth scroll-behavior ; scroll() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scroll() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scroll() with smooth behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
@ -44,21 +23,9 @@
[Element with smooth scroll-behavior ; scrollTo() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollTo() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollTo() with smooth behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with default behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Element with auto scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -68,9 +35,6 @@
[Element with smooth scroll-behavior ; scrollBy() with auto behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollBy() with instant behavior]
expected: FAIL
[Element with smooth scroll-behavior ; scrollBy() with smooth behavior]
expected: FAIL
@ -98,17 +62,8 @@
[Element with smooth scroll-behavior ; scrollIntoView() with smooth behavior]
expected: FAIL
[Set scrollLeft to element with auto scroll-behavior]
expected: FAIL
[Set scrollLeft to element with smooth scroll-behavior]
expected: FAIL
[Set scrollTop to element with auto scroll-behavior]
expected: FAIL
[Set scrollTop to element with smooth scroll-behavior]
expected: FAIL
[Aborting an ongoing smooth scrolling on an element with another smooth scrolling]
expected: FAIL

View file

@ -2,66 +2,11 @@
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollIntoView() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when aborting a smooth scrolling with an instant scrolling]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 0) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 500) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when aborting a smooth scrolling with another smooth scrolling]
expected: FAIL
[Scroll positions when performing smooth scrolling from (1000, 500) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scroll() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollTo() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from (0, 0) to (500, 250) using scrollBy() ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 500 to 250 by setting scrollTop ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 1000 to 500 by setting scrollLeft ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 0 to 500 by setting scrollLeft ]
expected: FAIL
[Scroll positions when performing smooth scrolling from 0 to 250 by setting scrollTop ]
expected: FAIL

View file

@ -17,15 +17,6 @@
[scrollingElement in non-quirks mode]
expected: FAIL
[scroll() on the root element in non-quirks mode]
expected: FAIL
[scrollBy() on the root element in non-quirks mode]
expected: FAIL
[scrollLeft/scrollTop on the root element in non-quirks mode]
expected: FAIL
[scrollWidth/scrollHeight on the root element in non-quirks mode]
expected: FAIL
@ -43,4 +34,3 @@
[scrollLeft/scrollRight of the content in non-quirks mode]
expected: FAIL

View file

@ -1,4 +0,0 @@
[fieldset-overflow-cssomview.html]
[Test cssom-view API for FIELDSET]
expected: FAIL