Changeset 274853 in webkit


Ignore:
Timestamp:
Mar 23, 2021 1:52:12 AM (16 months ago)
Author:
commit-queue@webkit.org
Message:

No scrolling momentum with 'scroll-snap-type: x mandatory' if the scroller scrolls vertically
https://bugs.webkit.org/show_bug.cgi?id=213571
<rdar://problem/64715507>

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-03-23
Reviewed by Simon Fraser.

Source/WebCore:

When handling momentum scrolling for scroll containers that snap, use the
predicted momentum scroll destination for axes that do not snap. Using
the initial scroll offset here was causing momentum scrolling in these axes
to end prematurely.

Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html

  • platform/ScrollSnapAnimatorState.cpp:

(WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset const): Use the predicted
scroll offset. Even though the startOffset parameter is no longer used, do not remove
it because it will be used in the fix for https://bugs.webkit.org/show_bug.cgi?id=223406.

LayoutTests:

  • tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt: Added.
  • tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r274852 r274853  
     12021-03-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        No scrolling momentum with 'scroll-snap-type: x mandatory' if the scroller scrolls vertically
     4        https://bugs.webkit.org/show_bug.cgi?id=213571
     5        <rdar://problem/64715507>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis-expected.txt: Added.
     10        * tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html: Added.
     11
    1122021-03-23  Said Abou-Hallawa  <said@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r274852 r274853  
     12021-03-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        No scrolling momentum with 'scroll-snap-type: x mandatory' if the scroller scrolls vertically
     4        https://bugs.webkit.org/show_bug.cgi?id=213571
     5        <rdar://problem/64715507>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When handling momentum scrolling for scroll containers that snap, use the
     10        predicted momentum scroll destination for axes that do not snap. Using
     11        the initial scroll offset here was causing momentum scrolling in these axes
     12        to end prematurely.
     13
     14        Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-momentum-in-non-snapping-axis.html
     15
     16        * platform/ScrollSnapAnimatorState.cpp:
     17        (WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset const): Use the predicted
     18        scroll offset. Even though the startOffset parameter is no longer used, do not remove
     19        it because it will be used in the fix for https://bugs.webkit.org/show_bug.cgi?id=223406.
     20
    1212021-03-23  Said Abou-Hallawa  <said@apple.com>
    222
  • trunk/Source/WebCore/platform/ScrollSnapAnimatorState.cpp

    r274726 r274853  
    9797    if (snapOffsets.isEmpty()) {
    9898        outActiveSnapIndex = invalidSnapOffsetIndex;
    99         return clampTo<float>(startOffset, 0, maxScrollOffset);
     99        return clampTo<float>(predictedOffset, 0, maxScrollOffset);
    100100    }
    101101
Note: See TracChangeset for help on using the changeset viewer.