Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d390890aae723e08d30bff8afbf72785e7cbaa87
      
https://github.com/WebKit/WebKit/commit/d390890aae723e08d30bff8afbf72785e7cbaa87
  Author: Simon Fraser <[email protected]>
  Date:   2026-03-28 (Sat, 28 Mar 2026)

  Changed paths:
    R 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt
    R 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero.html
    A 
LayoutTests/fast/scrolling/ios/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt
    A 
LayoutTests/fast/scrolling/ios/cancel-animated-scroll-should-not-scroll-from-zero.html
    A 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-main-frame-expected.txt
    A 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-main-frame.html
    A 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-overflow-expected.txt
    A 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-overflow.html
    A LayoutTests/fast/scrolling/ios/smooth-scroll-animates-expected.txt
    A LayoutTests/fast/scrolling/ios/smooth-scroll-animates.html
    A 
LayoutTests/fast/scrolling/mac/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt
    A 
LayoutTests/fast/scrolling/mac/cancel-animated-scroll-should-not-scroll-from-zero.html
    A 
LayoutTests/fast/scrolling/programmatic-smooth-then-immediate-cancels-animation-expected.txt
    A 
LayoutTests/fast/scrolling/programmatic-smooth-then-immediate-cancels-animation.html
    M Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
    M Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
    M Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h
    M 
Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.cpp
    M Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M 
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

  Log Message:
  -----------
  Cannot set scrollTop during momentum scroll phase
https://bugs.webkit.org/show_bug.cgi?id=187449
rdar://41949531

Reviewed by Abrar Rahman Protyasha.

Historically, `scrollTo` has interrupted momentum scrolling on iOS, but not 
macOS. Interactions
between programmatic and user scrolling are not specified, but it's a better 
user experience if
momentum scrolls continue when content calls `scrollTo` (some virtual scrollers 
required it for
good behavior).

This change fixes that. For iOS main frame, 
`RemoteScrollingCoordinatorProxy::adjustMainFrameDelegatedScrollPosition()`
now simply passes `InterruptScrollAnimation::No`. For subscrollers, the change 
in
`ScrollingTreeScrollingNode::handleScrollPositionRequest()` ensures that only 
programmatic
scrolls are interrupted, but we have to do some plumbing of 
`AnimatedScrollType` so that
`ScrollingTreeScrollingNodeDelegateIOS::stopAnimatedScroll()` knows which 
scroll types to
interrupt (it's unique to iOS that an "animated scroll" on the UIScrollView can 
be either
started by the user, or by a programmatic scroll).

During this investigation, I discovered that smooth scrolls on the root were no 
longer smooth on iOS;
the change in `_scrollToContentScrollPosition:` fixes this, and 
`smooth-scroll-animates.html`
tests it.

The `cancel-animated-scroll-should-not-scroll-from-zero.html` test was forked 
for iOS;
it used the wheel event monitor machinery, which only works on macOS.

Tests: 
fast/scrolling/ios/cancel-animated-scroll-should-not-scroll-from-zero.html
       
fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-main-frame.html
       
fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-overflow.html
       fast/scrolling/ios/smooth-scroll-animates.html
       
fast/scrolling/mac/cancel-animated-scroll-should-not-scroll-from-zero.html
       fast/scrolling/programmatic-smooth-then-immediate-cancels-animation.html

* 
LayoutTests/fast/scrolling/ios/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt:
 Copied from 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt.
* 
LayoutTests/fast/scrolling/ios/cancel-animated-scroll-should-not-scroll-from-zero.html:
 Copied from 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero.html.
* 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-main-frame-expected.txt:
 Added.
* 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-main-frame.html:
 Added.
* 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-overflow-expected.txt:
 Added.
* 
LayoutTests/fast/scrolling/ios/scrollto-does-not-interrupt-momentum-scroll-overflow.html:
 Added.
* LayoutTests/fast/scrolling/ios/smooth-scroll-animates-expected.txt: Added.
* LayoutTests/fast/scrolling/ios/smooth-scroll-animates.html: Added.
* 
LayoutTests/fast/scrolling/mac/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt:
 Renamed from 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero-expected.txt.
* 
LayoutTests/fast/scrolling/mac/cancel-animated-scroll-should-not-scroll-from-zero.html:
 Renamed from 
LayoutTests/fast/scrolling/cancel-animated-scroll-should-not-scroll-from-zero.html.
* 
LayoutTests/fast/scrolling/programmatic-smooth-then-immediate-cancels-animation-expected.txt:
 Added.
* 
LayoutTests/fast/scrolling/programmatic-smooth-then-immediate-cancels-animation.html:
 Added.
* Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::stopAnimatedScroll):
(WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
* Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h:
* Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
* Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.cpp:
(WebCore::ThreadedScrollingTreeScrollingNodeDelegate::stopAnimatedScroll):
* Source/WebCore/page/scrolling/ThreadedScrollingTreeScrollingNodeDelegate.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView 
_scrollToContentScrollPosition:scrollOrigin:animated:interruptAnimation:]):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::adjustMainFrameDelegatedScrollPosition):
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* 
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::stopAnimatedScroll):

Canonical link: https://commits.webkit.org/310169@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to