haikuwebkit/LayoutTests/css3/scroll-snap
Martin Robinson 9af778b12c [css-scroll-snap] Triggering a layout during scroll causes jittery scrolling on Mac when dragging the scrollbar
https://bugs.webkit.org/show_bug.cgi?id=227478

Reviewed by Simon Fraser.

Source/WebCore:

When dragging the scrollbar thumb, wait to resnap after layout for a
given axis until the mouse button is up on the scrollbar. This prevents
the layout and the scrollbar from fighting to set the scroll position
which causes some pretty terrible jitter in this case.

Test: css3/scroll-snap/scroll-snap-drag-scrollbar-thumb-with-relayouts.html

* platform/ScrollAnimationSmooth.cpp:
(WebCore::ScrollAnimationSmooth::updatePerAxisData): Fix an issue where the new position
was calculated incorrectly. This did not cause the animation to land on the wrong place,
but did cause a very janky animation progression when retriggering animations to the
same location.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::retargetRunningAnimation): Added this helper, which retargets a
a running animation to allow for a smooth transition during relayouts.
* platform/ScrollAnimator.h: Added new method definition.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::resnapAfterLayout): Only snap after layout when the user is not
currently interacting with the scrollbar. Once the scrollbar isn't being interacted with,
snapping will occur already. When there is already some sort of animation in progress,
smoothly transition that animation to land on the new position instead of snapping there
immediately.

LayoutTests:

* css3/scroll-snap/scroll-snap-drag-scrollbar-thumb-with-relayouts-expected.txt: Added.
* css3/scroll-snap/scroll-snap-drag-scrollbar-thumb-with-relayouts.html: Added.
* platform/ios/TestExpectations: Skip this test on iOS since it uses a scrollbar thumb drag.


Canonical link: https://commits.webkit.org/239395@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-05 09:21:05 +00:00
..
resources Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
nested-elements-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
nested-elements.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-padding-mainframe-paging-expected.txt scroll-padding should affect paging operations 2021-01-25 09:45:47 +00:00
scroll-padding-mainframe-paging.html [GTK][WPE] Implement support for CSS Scroll Snap 2021-02-18 08:49:40 +00:00
scroll-padding-overflow-paging-expected.txt scroll-padding should affect paging operations 2021-01-25 09:45:47 +00:00
scroll-padding-overflow-paging.html scroll-padding should affect paging operations 2021-01-25 09:45:47 +00:00
scroll-snap-2d-change-axis-type-expected.txt
scroll-snap-2d-change-axis-type-rtl-expected.txt
scroll-snap-2d-change-axis-type-rtl.html
scroll-snap-2d-change-axis-type.html
scroll-snap-2d-offsets-computed-independently-expected.txt
scroll-snap-2d-offsets-computed-independently.html
scroll-snap-2d-offsets-computed-independently.rtl-expected.txt
scroll-snap-2d-offsets-computed-independently.rtl.html
scroll-snap-children-with-overflow-expected.txt
scroll-snap-children-with-overflow.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-children-with-padding-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-children-with-padding.html
scroll-snap-children-with-scroll-snap-margin-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-children-with-scroll-snap-margin.html
scroll-snap-children-with-transforms-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-children-with-transforms.html
scroll-snap-click-scrollbar-gutter-expected.txt Scroll snapping doesn't kick in when dragging scrollbars 2021-03-01 21:32:19 +00:00
scroll-snap-click-scrollbar-gutter.html CSS scroll snap should allow scrolling to the middle of snap areas that overflow the snapport 2021-06-29 07:14:08 +00:00
scroll-snap-drag-scrollbar-thumb-expected.txt Scroll snapping doesn't kick in when dragging scrollbars 2021-03-01 21:32:19 +00:00
scroll-snap-drag-scrollbar-thumb-with-relayouts-expected.txt [css-scroll-snap] Triggering a layout during scroll causes jittery scrolling on Mac when dragging the scrollbar 2021-07-05 09:21:05 +00:00
scroll-snap-drag-scrollbar-thumb-with-relayouts.html [css-scroll-snap] Triggering a layout during scroll causes jittery scrolling on Mac when dragging the scrollbar 2021-07-05 09:21:05 +00:00
scroll-snap-drag-scrollbar-thumb.html Scroll snapping doesn't kick in when dragging scrollbars 2021-03-01 21:32:19 +00:00
scroll-snap-elements-container-larger-than-children-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-elements-container-larger-than-children-rtl-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-elements-container-larger-than-children-rtl.html
scroll-snap-elements-container-larger-than-children.html
scroll-snap-iframe-expected.txt
scroll-snap-iframe-rtl-expected.txt
scroll-snap-iframe-rtl.html
scroll-snap-iframe.html
scroll-snap-inherit-expected.txt Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-inherit.html Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-initial-expected.txt Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-initial.html Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-mismatch-expected.txt
scroll-snap-mismatch.html [css-scroll-snap] scroll-snap-align parsing is incorrect/backwards 2021-01-14 11:02:43 +00:00
scroll-snap-offsets-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-offsets-mixed-rtl-expected.txt
scroll-snap-offsets-mixed-rtl.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-offsets-rtl-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-offsets-rtl.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-offsets.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-on-independently-scrollable-body-expected.txt Add a test to exercise CSS scroll snap in an independently scrollable body 2021-02-17 17:58:58 +00:00
scroll-snap-on-independently-scrollable-body.html Add a test to exercise CSS scroll snap in an independently scrollable body 2021-02-17 17:58:58 +00:00
scroll-snap-positions-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-positions-mainframe-expected.txt
scroll-snap-positions-mainframe.html Scroll snap specified on :root doesn't work 2020-11-06 09:44:54 +00:00
scroll-snap-positions-overflow-resize-expected.txt Many CSS js-tests use waitUntilDone 2017-05-19 21:19:00 +00:00
scroll-snap-positions-overflow-resize.html
scroll-snap-positions.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-programmatic-overflow-scroll-expected.txt
scroll-snap-programmatic-overflow-scroll.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-property-computed-style-expected.txt Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-property-computed-style.html
scroll-snap-property-computed-style.js Improve the serialization of scroll-snap-type and scroll-snap-align 2021-02-04 12:01:29 +00:00
scroll-snap-property-parsing-expected.txt axis in scroll-snap-type should be required 2020-10-19 09:24:46 +00:00
scroll-snap-property-parsing.html
scroll-snap-property-parsing.js axis in scroll-snap-type should be required 2020-10-19 09:24:46 +00:00
scroll-snap-right-to-left-initial-snapping-expected.txt [css-scroll-snap] Scroll snap offsets are interpreted as scroll positions in ScrollableArea 2021-06-15 11:09:34 +00:00
scroll-snap-right-to-left-initial-snapping.html [css-scroll-snap] Scroll snap offsets are interpreted as scroll positions in ScrollableArea 2021-06-15 11:09:34 +00:00
scroll-snap-style-change-crash-expected.txt More readily layout when scroll-snap properties change 2021-05-28 08:59:20 +00:00
scroll-snap-style-change-crash.html More readily layout when scroll-snap properties change 2021-05-28 08:59:20 +00:00
scroll-snap-style-changed-align-expected.txt
scroll-snap-style-changed-align.html Remove experimental: and internal: prefixes from test header commands 2020-11-04 15:56:26 +00:00
scroll-snap-wheel-event-expected.txt Add basic (non-momentum) wheel event handling for scroll snap 2021-04-21 09:04:24 +00:00
scroll-snap-wheel-event.html Add basic (non-momentum) wheel event handling for scroll snap 2021-04-21 09:04:24 +00:00
scroll-snap-with-scroll-padding-expected.txt Scroll snap: don't create implicit snap points at scrollmin/scrollmax 2020-10-22 07:32:40 +00:00
scroll-snap-with-scroll-padding.html