[Webkit-unassigned] [Bug 255193] New: Consider not stopping scroll inertia animations when setting scrollTop, or, recalculate the animation and resume it.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 8 13:02:14 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=255193

            Bug ID: 255193
           Summary: Consider not stopping scroll inertia animations when
                    setting scrollTop, or, recalculate the animation and
                    resume it.
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Scrolling
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nick at quebic.com
                CC: simon.fraser at apple.com

At the moment, using Webkit (WkWebView) on iOS, when the user sets the `scrollTop` property of a scrollable div, WebKit currently clears all running animations on that ScrollView (Which includes rubber-band / touch inertia animations).

This makes it impossible to create a smoothly scrolling div, that adjusts the scroll position while the user swipes to scroll (The user will snap to the position with all momentum halting abruptly).

It is also worth noting that all stock iOS & macOS native controls allow you to keep the momentum going when adjusting the scroll position.

Chromium on Android preserves the momentum and continues the animation as if it was started from the new scroll position.

It would make sense to preserve this when the user wants inertia / rubber-banding.

The relevant code that is currently stopping the animation is:

https://github.com/WebKit/WebKit/blob/main/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp#L306

Which on iOS, is calling the following API `_stopScrollingAndZoomingAnimations` on the UIScrollView:

https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm#L337

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230408/830bfb9d/attachment.htm>


More information about the webkit-unassigned mailing list