<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[283792] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/283792">283792</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2021-10-07 21:30:33 -0700 (Thu, 07 Oct 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add some plumbing for running smooth scroll animations in the scrolling thread/UI process
https://bugs.webkit.org/show_bug.cgi?id=231402

Reviewed by Tim Horton.

Source/WebCore:

These change prepare the scrolling tree to handle the starting and cancelation of
programmatic smooth scroll animations.

ScrollableArea subclasses implement requestAnimatedScrollToPosition() and
stopAsyncAnimatedScroll(), akin to the existing requestScrollPositionUpdate(). FrameView and
RenderLayerScrollableArea call through to AsyncScrollingCoordinator, which will soon respond
to these requests by setting state on scrolling state nodes. Currently,
AsyncScrollingCoordinator does `return false` to avoid a behavior change.

ScrollingTreeScrollingNode gains startAnimatedScrollToPosition() and stopAnimatedScroll(),
and concrete subclasses use their ScrollingTreeScrollingNodeDelegate (and its
ScrollingEffectsController) to actually trigger the scroll animation, or stop an existing
one.

RequestedScrollData will be used a bit more widely, so move it to
ScrollingCoordinatorTypes.h, and give it a ScrollIsAnimated field.

* dom/Element.cpp:
(WebCore::Element::scrollTo):
* page/FrameView.cpp:
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::requestAnimatedScrollToPosition):
(WebCore::FrameView::stopAsyncAnimatedScroll):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::requestAnimatedScrollToPosition):
(WebCore::AsyncScrollingCoordinator::stopAnimatedScroll):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::ScrollingCoordinator::requestAnimatedScrollToPosition):
(WebCore::ScrollingCoordinator::stopAnimatedScroll):
* page/scrolling/ScrollingCoordinatorTypes.h:
(WebCore::RequestedScrollData::operator== const):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::RequestedScrollData::operator== const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::didStopAnimatedScroll):
(WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopAnimatedScroll):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::stopAnimatedScroll):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopAnimatedScroll):
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopAnimatedScroll):
(WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): Deleted.
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
* page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopAnimatedScroll):
(WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): Deleted.
* page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h:
* page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp:
(WebCore::ScrollingTreeScrollingNodeDelegateNicosia::startAnimatedScrollToPosition):
(WebCore::ScrollingTreeScrollingNodeDelegateNicosia::stopAnimatedScroll):
(WebCore::ScrollingTreeScrollingNodeDelegateNicosia::stopScrollAnimations): Deleted.
* page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h:
* platform/ScrollTypes.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToPositionWithAnimation):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::requestAnimatedScrollToPosition):
(WebCore::ScrollableArea::stopAsyncAnimatedScroll):
* rendering/RenderLayerScrollableArea.cpp:
(WebCore::RenderLayerScrollableArea::requestAnimatedScrollToPosition):
(WebCore::RenderLayerScrollableArea::stopAsyncAnimatedScroll):
* rendering/RenderLayerScrollableArea.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<RequestedScrollData>::encode):
(ArgumentCoder<RequestedScrollData>::decode):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::startAnimatedScrollToPosition):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::stopAnimatedScroll):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingCoordinatorh">trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingCoordinatorTypesh">trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeDelegateh">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMach">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeOverflowScrollingNodeMach">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeOverflowScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMach">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeFrameScrollingNodeNicosiacpp">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeFrameScrollingNodeNicosiah">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeOverflowScrollingNodeNicosiacpp">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeOverflowScrollingNodeNicosiah">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeScrollingNodeDelegateNicosiacpp">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingnicosiaScrollingTreeScrollingNodeDelegateNicosiah">trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollTypesh">trunk/Source/WebCore/platform/ScrollTypes.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerScrollableAreacpp">trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerScrollableAreah">trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteScrollingCoordinatorTransactioncpp">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/ChangeLog      2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -1,3 +1,98 @@
</span><ins>+2021-10-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Add some plumbing for running smooth scroll animations in the scrolling thread/UI process
+        https://bugs.webkit.org/show_bug.cgi?id=231402
+
+        Reviewed by Tim Horton.
+
+        These change prepare the scrolling tree to handle the starting and cancelation of
+        programmatic smooth scroll animations.
+
+        ScrollableArea subclasses implement requestAnimatedScrollToPosition() and
+        stopAsyncAnimatedScroll(), akin to the existing requestScrollPositionUpdate(). FrameView and
+        RenderLayerScrollableArea call through to AsyncScrollingCoordinator, which will soon respond
+        to these requests by setting state on scrolling state nodes. Currently,
+        AsyncScrollingCoordinator does `return false` to avoid a behavior change.
+
+        ScrollingTreeScrollingNode gains startAnimatedScrollToPosition() and stopAnimatedScroll(),
+        and concrete subclasses use their ScrollingTreeScrollingNodeDelegate (and its
+        ScrollingEffectsController) to actually trigger the scroll animation, or stop an existing
+        one.
+
+        RequestedScrollData will be used a bit more widely, so move it to
+        ScrollingCoordinatorTypes.h, and give it a ScrollIsAnimated field.
+
+        * dom/Element.cpp:
+        (WebCore::Element::scrollTo):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setScrollPosition):
+        (WebCore::FrameView::requestAnimatedScrollToPosition):
+        (WebCore::FrameView::stopAsyncAnimatedScroll):
+        * page/FrameView.h:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::AsyncScrollingCoordinator::requestAnimatedScrollToPosition):
+        (WebCore::AsyncScrollingCoordinator::stopAnimatedScroll):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::ScrollingCoordinator::requestAnimatedScrollToPosition):
+        (WebCore::ScrollingCoordinator::stopAnimatedScroll):
+        * page/scrolling/ScrollingCoordinatorTypes.h:
+        (WebCore::RequestedScrollData::operator== const):
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        (WebCore::ScrollingStateScrollingNode::dumpProperties const):
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        (WebCore::RequestedScrollData::operator== const): Deleted.
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::didStopAnimatedScroll):
+        (WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::stopAnimatedScroll):
+        * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
+        (WebCore::ScrollingTreeOverflowScrollingNodeMac::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeOverflowScrollingNodeMac::stopAnimatedScroll):
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopAnimatedScroll):
+        * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
+        (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeNicosia::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopAnimatedScroll):
+        (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): Deleted.
+        * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
+        * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
+        (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
+        (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopAnimatedScroll):
+        (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): Deleted.
+        * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h:
+        * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp:
+        (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::startAnimatedScrollToPosition):
+        (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::stopAnimatedScroll):
+        (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::stopScrollAnimations): Deleted.
+        * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h:
+        * platform/ScrollTypes.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setScrollPosition):
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scrollToPositionWithAnimation):
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::requestAnimatedScrollToPosition):
+        (WebCore::ScrollableArea::stopAsyncAnimatedScroll):
+        * rendering/RenderLayerScrollableArea.cpp:
+        (WebCore::RenderLayerScrollableArea::requestAnimatedScrollToPosition):
+        (WebCore::RenderLayerScrollableArea::stopAsyncAnimatedScroll):
+        * rendering/RenderLayerScrollableArea.h:
+
</ins><span class="cx"> 2021-10-07  Alexey Shvayka  <shvaikalesh@gmail.com>
</span><span class="cx"> 
</span><span class="cx">         `highWaterMark` should be a readonly WebIDL attribute of queuing strategies
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/dom/Element.cpp        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -1000,6 +1000,8 @@
</span><span class="cx"> 
</span><span class="cx"> void Element::scrollTo(const ScrollToOptions& options, ScrollClamping clamping, ScrollSnapPointSelectionMethod snapPointSelectionMethod)
</span><span class="cx"> {
</span><ins>+    LOG_WITH_STREAM(Scrolling, stream << "Element " << *this << " scrollTo " << options.left << ", " << options.top);
+
</ins><span class="cx">     if (!document().settings().CSSOMViewScrollingAPIEnabled()) {
</span><span class="cx">         // If the element is the root element and document is in quirks mode, terminate these steps.
</span><span class="cx">         // Note that WebKit always uses quirks mode document scrolling behavior. See Document::scrollingElement().
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/FrameView.cpp     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -2306,7 +2306,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FrameView::setScrollPosition(const ScrollPosition& scrollPosition, const ScrollPositionChangeOptions& options)
</span><span class="cx"> {
</span><del>-    LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " , clearing anchor");
</del><ins>+    LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " animated " << (options.animated == ScrollIsAnimated::Yes) << ", clearing anchor");
</ins><span class="cx"> 
</span><span class="cx">     auto oldScrollType = currentScrollType();
</span><span class="cx">     setCurrentScrollType(options.type);
</span><span class="lines">@@ -2687,6 +2687,30 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool FrameView::requestAnimatedScrollToPosition(const ScrollPosition& destinationPosition, ScrollClamping clamping)
+{
+    LOG_WITH_STREAM(Scrolling, stream << "FrameView::requestAnimatedScrollToPosition " << destinationPosition);
+
+#if ENABLE(ASYNC_SCROLLING)
+    if (auto scrollingCoordinator = this->scrollingCoordinator())
+        return scrollingCoordinator->requestAnimatedScrollToPosition(*this, destinationPosition, clamping);
+#else
+    UNUSED_PARAM(destinationPosition);
+#endif
+
+    return false;
+}
+
+void FrameView::stopAsyncAnimatedScroll()
+{
+#if ENABLE(ASYNC_SCROLLING)
+    LOG_WITH_STREAM(Scrolling, stream << "FrameView::stopAsyncAnimatedScroll");
+
+    if (auto scrollingCoordinator = this->scrollingCoordinator())
+        return scrollingCoordinator->stopAnimatedScroll(*this);
+#endif
+}
+
</ins><span class="cx"> HostWindow* FrameView::hostWindow() const
</span><span class="cx"> {
</span><span class="cx">     auto* page = frame().page();
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h    2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/FrameView.h       2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -246,7 +246,11 @@
</span><span class="cx">     void scrollToFocusedElementImmediatelyIfNeeded();
</span><span class="cx">     void updateLayerPositionsAfterScrolling() final;
</span><span class="cx">     void updateCompositingLayersAfterScrolling() final;
</span><ins>+
</ins><span class="cx">     bool requestScrollPositionUpdate(const ScrollPosition&, ScrollType = ScrollType::User, ScrollClamping = ScrollClamping::Clamped) final;
</span><ins>+    bool requestAnimatedScrollToPosition(const ScrollPosition&, ScrollClamping = ScrollClamping::Clamped) final;
+    void stopAsyncAnimatedScroll() final;
+
</ins><span class="cx">     bool isUserScrollInProgress() const final;
</span><span class="cx">     bool isRubberBandInProgress() const final;
</span><span class="cx">     WEBCORE_EXPORT ScrollPosition minimumScrollPosition() const final;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp   2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">     node->setHorizontalScrollbarLayer(frameView.layerForHorizontalScrollbar());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scrollableArea, const IntPoint& scrollPosition, ScrollType scrollType, ScrollClamping clamping)
</del><ins>+bool AsyncScrollingCoordinator::requestScrollPositionUpdate(ScrollableArea& scrollableArea, const ScrollPosition& scrollPosition, ScrollType scrollType, ScrollClamping clamping)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     ASSERT(m_page);
</span><span class="lines">@@ -275,11 +275,23 @@
</span><span class="cx">     if (!stateNode)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    stateNode->setRequestedScrollData({ scrollPosition, scrollType, clamping });
</del><ins>+    stateNode->setRequestedScrollData({ scrollPosition, scrollType, clamping, ScrollIsAnimated::No });
+    // FIXME: This should schedule a rendering update
</ins><span class="cx">     commitTreeStateIfNeeded();
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AsyncScrollingCoordinator::requestAnimatedScrollToPosition(ScrollableArea&, const ScrollPosition&, ScrollClamping)
+{
+    // FIXME: Implement.
+    return false;
+}
+
+void AsyncScrollingCoordinator::stopAnimatedScroll(ScrollableArea&)
+{
+    // FIXME: Implement.
+}
+
</ins><span class="cx"> void AsyncScrollingCoordinator::applyScrollingTreeLayerPositions()
</span><span class="cx"> {
</span><span class="cx">     m_scrollingTree->applyLayerPositions();
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -100,7 +100,9 @@
</span><span class="cx">     WEBCORE_EXPORT void frameViewVisualViewportChanged(FrameView&) override;
</span><span class="cx">     WEBCORE_EXPORT void frameViewEventTrackingRegionsChanged(FrameView&) override;
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&, ScrollType, ScrollClamping) override;
</del><ins>+    WEBCORE_EXPORT bool requestScrollPositionUpdate(ScrollableArea&, const ScrollPosition&, ScrollType, ScrollClamping) final;
+    WEBCORE_EXPORT bool requestAnimatedScrollToPosition(ScrollableArea&, const ScrollPosition&, ScrollClamping) final;
+    WEBCORE_EXPORT void stopAnimatedScroll(ScrollableArea&) final;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void applyScrollingTreeLayerPositions() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h       2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h  2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -112,7 +112,11 @@
</span><span class="cx"> 
</span><span class="cx">     // These virtual functions are currently unique to the threaded scrolling architecture. 
</span><span class="cx">     virtual void commitTreeStateIfNeeded() { }
</span><del>-    virtual bool requestScrollPositionUpdate(ScrollableArea&, const IntPoint&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped) { return false; }
</del><ins>+
+    virtual bool requestScrollPositionUpdate(ScrollableArea&, const ScrollPosition&, ScrollType = ScrollType::Programmatic, ScrollClamping = ScrollClamping::Clamped) { return false; }
+    virtual bool requestAnimatedScrollToPosition(ScrollableArea&, const ScrollPosition&, ScrollClamping) { return false; }
+    virtual void stopAnimatedScroll(ScrollableArea&) { }
+
</ins><span class="cx">     virtual bool handleWheelEventForScrolling(const PlatformWheelEvent&, ScrollingNodeID, std::optional<WheelScrollGestureState>) { return false; }
</span><span class="cx">     virtual void wheelEventWasProcessedByMainThread(const PlatformWheelEvent&, std::optional<WheelScrollGestureState>) { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -102,6 +102,20 @@
</span><span class="cx">     ChangingObscuredInsetsInteractively // This implies Unstable.
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+struct RequestedScrollData {
+    FloatPoint scrollPosition;
+    ScrollType scrollType { ScrollType::User };
+    ScrollClamping clamping { ScrollClamping::Clamped };
+    ScrollIsAnimated animated { ScrollIsAnimated::No };
+
+    bool operator==(const RequestedScrollData& other) const
+    {
+        return scrollPosition == other.scrollPosition
+            && scrollType == other.scrollType
+            && clamping == other.clamping;
+    }
+};
+
</ins><span class="cx"> struct ScrollUpdate {
</span><span class="cx">     ScrollingNodeID nodeID { 0 };
</span><span class="cx">     FloatPoint scrollPosition;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp      2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -297,6 +297,9 @@
</span><span class="cx">     if (m_requestedScrollData.clamping == ScrollClamping::Unclamped)
</span><span class="cx">         ts.dumpProperty("requested scroll position clamping", m_requestedScrollData.clamping);
</span><span class="cx"> 
</span><ins>+    if (m_requestedScrollData.animated == ScrollIsAnimated::Yes)
+        ts.dumpProperty("requested scroll position is animated", true);
+
</ins><span class="cx">     if (m_scrollOrigin != IntPoint())
</span><span class="cx">         ts.dumpProperty("scroll origin", m_scrollOrigin);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h        2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h   2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -38,19 +38,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct RequestedScrollData {
-    FloatPoint scrollPosition;
-    ScrollType scrollType { ScrollType::User };
-    ScrollClamping clamping { ScrollClamping::Clamped };
-    
-    bool operator==(const RequestedScrollData& other) const
-    {
-        return scrollPosition == other.scrollPosition
-            && scrollType == other.scrollType
-            && clamping == other.clamping;
-    }
-};
-
</del><span class="cx"> class ScrollingStateScrollingNode : public ScrollingStateNode {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~ScrollingStateScrollingNode();
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp       2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp  2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -227,6 +227,26 @@
</span><span class="cx">     scrollingTree().setNodeScrollSnapInProgress(scrollingNodeID(), isSnapping);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingTreeScrollingNode::didStopAnimatedScroll()
+{
+    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeScrollingNode " << scrollingNodeID() << " didStopAnimatedScroll");
+    // FIXME: Propagate state back to the main thread.
+}
+
+void ScrollingTreeScrollingNode::handleScrollPositionRequest(const RequestedScrollData& requestedScrollData)
+{
+    LOG_WITH_STREAM(Scrolling, stream << "ScrollingTreeScrollingNode " << scrollingNodeID() << " handleScrollPositionRequest() - position " << requestedScrollData.scrollPosition << " animated " << (requestedScrollData.animated == ScrollIsAnimated::Yes));
+
+    stopAnimatedScroll();
+    
+    if (requestedScrollData.animated == ScrollIsAnimated::Yes) {
+        if (startAnimatedScrollToPosition(requestedScrollData.scrollPosition))
+            return;
+    }
+
+    scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
+}
+
</ins><span class="cx"> FloatPoint ScrollingTreeScrollingNode::adjustedScrollPosition(const FloatPoint& scrollPosition, ScrollClamping clamping) const
</span><span class="cx"> {
</span><span class="cx">     if (clamping == ScrollClamping::Clamped)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h    2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     void scrollTo(const FloatPoint&, ScrollType = ScrollType::User, ScrollClamping = ScrollClamping::Clamped);
</span><span class="cx">     void scrollBy(const FloatSize&, ScrollClamping = ScrollClamping::Clamped);
</span><span class="cx"> 
</span><del>-    virtual void stopScrollAnimations() { };
</del><ins>+    void handleScrollPositionRequest(const RequestedScrollData&);
</ins><span class="cx"> 
</span><span class="cx">     void wasScrolledByDelegatedScrolling(const FloatPoint& position, std::optional<FloatRect> overrideLayoutViewport = { }, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
</span><span class="cx">     
</span><span class="lines">@@ -123,6 +123,9 @@
</span><span class="cx">     virtual void willDoProgrammaticScroll(const FloatPoint&) { }
</span><span class="cx">     
</span><span class="cx">     virtual FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping = ScrollClamping::Clamped) const;
</span><ins>+    
+    virtual bool startAnimatedScrollToPosition(FloatPoint) { return false; }
+    virtual void stopAnimatedScroll() { }
</ins><span class="cx"> 
</span><span class="cx">     virtual void currentScrollPositionChanged(ScrollType, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
</span><span class="cx">     virtual void updateViewportForCurrentScrollPosition(std::optional<FloatRect> = { }) { }
</span><span class="lines">@@ -133,6 +136,8 @@
</span><span class="cx"> 
</span><span class="cx">     void applyLayerPositions() override;
</span><span class="cx"> 
</span><ins>+    void didStopAnimatedScroll();
+
</ins><span class="cx">     const FloatSize& reachableContentsSize() const { return m_reachableContentsSize; }
</span><span class="cx">     
</span><span class="cx">     bool isLatchedNode() const;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h 2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNodeDelegate.h    2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -38,6 +38,9 @@
</span><span class="cx"> 
</span><span class="cx">     ScrollingTreeScrollingNode& scrollingNode() { return m_scrollingNode; }
</span><span class="cx">     const ScrollingTreeScrollingNode& scrollingNode() const { return m_scrollingNode; }
</span><ins>+    
+    virtual bool startAnimatedScrollToPosition(FloatPoint) = 0;
+    virtual void stopAnimatedScroll() = 0;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     WEBCORE_EXPORT ScrollingTree& scrollingTree() const;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">     void willBeDestroyed() final;
</span><span class="cx">     void willDoProgrammaticScroll(const FloatPoint&) final;
</span><span class="cx"> 
</span><ins>+    bool startAnimatedScrollToPosition(FloatPoint) final;
+    void stopAnimatedScroll() final;
+
</ins><span class="cx">     FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping) const final;
</span><span class="cx"> 
</span><span class="cx">     void currentScrollPositionChanged(ScrollType, ScrollingLayerPositionAction) final;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm    2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm       2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -105,10 +105,8 @@
</span><span class="cx">     const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
</span><span class="cx"> 
</span><span class="cx">     // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
</span><del>-    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
-        const auto& requestedScrollData = scrollingStateNode.requestedScrollData();
-        scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
-    }
</del><ins>+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition))
+        handleScrollPositionRequest(scrollingStateNode.requestedScrollData());
</ins><span class="cx"> 
</span><span class="cx">     if (isRootNode()
</span><span class="cx">         && (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::ScrolledContentsLayer)
</span><span class="lines">@@ -132,6 +130,16 @@
</span><span class="cx">     return WheelEventHandlingResult::result(handled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeFrameScrollingNodeMac::startAnimatedScrollToPosition(FloatPoint destinationPosition)
+{
+    return m_delegate.startAnimatedScrollToPosition(destinationPosition);
+}
+
+void ScrollingTreeFrameScrollingNodeMac::stopAnimatedScroll()
+{
+    m_delegate.stopAnimatedScroll();
+}
+
</ins><span class="cx"> void ScrollingTreeFrameScrollingNodeMac::willDoProgrammaticScroll(const FloatPoint& targetScrollPosition)
</span><span class="cx"> {
</span><span class="cx">     m_delegate.willDoProgrammaticScroll(targetScrollPosition);
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeOverflowScrollingNodeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx">     
</span><span class="cx">     FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping) const override;
</span><span class="cx"> 
</span><ins>+    bool startAnimatedScrollToPosition(FloatPoint destinationPosition) override;
+    void stopAnimatedScroll() override;
+
</ins><span class="cx">     void currentScrollPositionChanged(ScrollType, ScrollingLayerPositionAction) final;
</span><span class="cx">     void willDoProgrammaticScroll(const FloatPoint&) final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeOverflowScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm 2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm    2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -67,10 +67,8 @@
</span><span class="cx"> 
</span><span class="cx">     const auto& overflowStateNode = downcast<ScrollingStateOverflowScrollingNode>(stateNode);
</span><span class="cx"> 
</span><del>-    if (overflowStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
-        const auto& requestedScrollData = overflowStateNode.requestedScrollData();
-        scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
-    }
</del><ins>+    if (overflowStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition))
+        handleScrollPositionRequest(overflowStateNode.requestedScrollData());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WheelEventHandlingResult ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent, EventTargeting eventTargeting)
</span><span class="lines">@@ -86,6 +84,16 @@
</span><span class="cx">     return WheelEventHandlingResult::result(m_delegate.handleWheelEvent(wheelEvent));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeOverflowScrollingNodeMac::startAnimatedScrollToPosition(FloatPoint destinationPosition)
+{
+    return m_delegate.startAnimatedScrollToPosition(destinationPosition);
+}
+
+void ScrollingTreeOverflowScrollingNodeMac::stopAnimatedScroll()
+{
+    m_delegate.stopAnimatedScroll();
+}
+
</ins><span class="cx"> void ScrollingTreeOverflowScrollingNodeMac::willDoProgrammaticScroll(const FloatPoint& targetScrollPosition)
</span><span class="cx"> {
</span><span class="cx">     m_delegate.willDoProgrammaticScroll(targetScrollPosition);
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -51,7 +51,10 @@
</span><span class="cx">     void nodeWillBeDestroyed();
</span><span class="cx"> 
</span><span class="cx">     bool handleWheelEvent(const PlatformWheelEvent&);
</span><del>-    
</del><ins>+
+    bool startAnimatedScrollToPosition(FloatPoint) final;
+    void stopAnimatedScroll() final;
+
</ins><span class="cx">     void willDoProgrammaticScroll(const FloatPoint&);
</span><span class="cx">     void currentScrollPositionChanged();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm    2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -113,6 +113,19 @@
</span><span class="cx">     return m_scrollController.handleWheelEvent(wheelEvent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeScrollingNodeDelegateMac::startAnimatedScrollToPosition(FloatPoint destinationPosition)
+{
+    auto currentOffset = ScrollableArea::scrollOffsetFromPosition(currentScrollPosition(), scrollOrigin());
+    auto destinationOffset = ScrollableArea::scrollOffsetFromPosition(destinationPosition, scrollOrigin());
+    
+    return m_scrollController.startAnimatedScrollToDestination(currentOffset, destinationOffset);
+}
+
+void ScrollingTreeScrollingNodeDelegateMac::stopAnimatedScroll()
+{
+    m_scrollController.stopAnimatedScroll();
+}
+
</ins><span class="cx"> void ScrollingTreeScrollingNodeDelegateMac::willDoProgrammaticScroll(const FloatPoint& targetPosition)
</span><span class="cx"> {
</span><span class="cx">     if (scrollPositionIsNotRubberbandingEdge(targetPosition)) {
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeFrameScrollingNodeNicosiacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp   2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp      2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -93,11 +93,8 @@
</span><span class="cx">     const auto& scrollingStateNode = downcast<ScrollingStateScrollingNode>(stateNode);
</span><span class="cx"> 
</span><span class="cx">     // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
</span><del>-    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
-        stopScrollAnimations();
-        const auto& requestedScrollData = scrollingStateNode.requestedScrollData();
-        scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
-    }
</del><ins>+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition))
+        handleScrollPositionRequest(scrollingStateNode.requestedScrollData());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WheelEventHandlingResult ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent(const PlatformWheelEvent& wheelEvent, EventTargeting eventTargeting)
</span><span class="lines">@@ -105,11 +102,16 @@
</span><span class="cx">     return m_delegate.handleWheelEvent(wheelEvent, eventTargeting);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations()
</del><ins>+bool ScrollingTreeFrameScrollingNodeNicosia::startAnimatedScrollToPosition(FloatPoint destinationPosition)
</ins><span class="cx"> {
</span><del>-    m_delegate.stopScrollAnimations();
</del><ins>+    return m_delegate.startAnimatedScrollToPosition(destinationPosition);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingTreeFrameScrollingNodeNicosia::stopAnimatedScroll()
+{
+    m_delegate.stopAnimatedScroll();
+}
+
</ins><span class="cx"> FloatPoint ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition(const FloatPoint& position, ScrollClamping clamping) const
</span><span class="cx"> {
</span><span class="cx">     FloatPoint scrollPosition(roundf(position.x()), roundf(position.y()));
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeFrameScrollingNodeNicosiah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -55,11 +55,12 @@
</span><span class="cx">     void commitStateBeforeChildren(const ScrollingStateNode&) override;
</span><span class="cx">     void commitStateAfterChildren(const ScrollingStateNode&) override;
</span><span class="cx"> 
</span><ins>+    bool startAnimatedScrollToPosition(FloatPoint) override;
+    void stopAnimatedScroll() override;
</ins><span class="cx"> 
</span><span class="cx">     WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, EventTargeting) override;
</span><span class="cx">     FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping) const override;
</span><span class="cx">     void currentScrollPositionChanged(ScrollType, ScrollingLayerPositionAction) override;
</span><del>-    void stopScrollAnimations() override;
</del><span class="cx">     void repositionScrollingLayers() override;
</span><span class="cx">     void repositionRelatedLayers() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeOverflowScrollingNodeNicosiacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp        2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp   2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -52,11 +52,8 @@
</span><span class="cx">     ScrollingTreeOverflowScrollingNode::commitStateAfterChildren(stateNode);
</span><span class="cx"> 
</span><span class="cx">     const auto& overflowStateNode = downcast<ScrollingStateOverflowScrollingNode>(stateNode);
</span><del>-    if (overflowStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
-        stopScrollAnimations();
-        const auto& requestedScrollData = overflowStateNode.requestedScrollData();
-        scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
-    }
</del><ins>+    if (overflowStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition))
+        handleScrollPositionRequest(overflowStateNode.requestedScrollData());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatPoint ScrollingTreeOverflowScrollingNodeNicosia::adjustedScrollPosition(const FloatPoint& position, ScrollClamping clamping) const
</span><span class="lines">@@ -88,11 +85,16 @@
</span><span class="cx">     return m_delegate.handleWheelEvent(wheelEvent, eventTargeting);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations()
</del><ins>+bool ScrollingTreeOverflowScrollingNodeNicosia::startAnimatedScrollToPosition(FloatPoint destinationPosition)
</ins><span class="cx"> {
</span><del>-    m_delegate.stopScrollAnimations();
</del><ins>+    return m_delegate.startAnimatedScrollToPosition(destinationPosition);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingTreeOverflowScrollingNodeNicosia::stopAnimatedScroll()
+{
+    m_delegate.stopAnimatedScroll();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeOverflowScrollingNodeNicosiah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -49,8 +49,10 @@
</span><span class="cx">     FloatPoint adjustedScrollPosition(const FloatPoint&, ScrollClamping) const override;
</span><span class="cx">     void repositionScrollingLayers() override;
</span><span class="cx">     WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, EventTargeting) override;
</span><del>-    void stopScrollAnimations() override;
</del><span class="cx"> 
</span><ins>+    bool startAnimatedScrollToPosition(FloatPoint) override;
+    void stopAnimatedScroll() override;
+
</ins><span class="cx">     ScrollingTreeScrollingNodeDelegateNicosia m_delegate;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeScrollingNodeDelegateNicosiacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp        2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp   2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -86,11 +86,6 @@
</span><span class="cx">     return WheelEventHandlingResult::handled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingTreeScrollingNodeDelegateNicosia::stopScrollAnimations()
-{
-    m_scrollController.stopAnimatedScroll();
-}
-
</del><span class="cx"> void ScrollingTreeScrollingNodeDelegateNicosia::animationTimerFired()
</span><span class="cx"> {
</span><span class="cx">     m_scrollController.animationCallback(MonotonicTime::now());
</span><span class="lines">@@ -182,6 +177,19 @@
</span><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeScrollingNodeDelegateNicosia::startAnimatedScrollToPosition(FloatPoint destinationPosition)
+{
+    auto currentOffset = ScrollableArea::scrollOffsetFromPosition(currentScrollPosition(), scrollOrigin());
+    auto destinationOffset = ScrollableArea::scrollOffsetFromPosition(destinationPosition, scrollOrigin());
+    
+    return m_scrollController.startAnimatedScrollToDestination(currentOffset, destinationOffset);
+}
+
+void ScrollingTreeScrollingNodeDelegateNicosia::stopAnimatedScroll()
+{
+    m_scrollController.stopAnimatedScroll();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASYNC_SCROLLING) && USE(NICOSIA)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingnicosiaScrollingTreeScrollingNodeDelegateNicosiah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h  2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h     2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING) && USE(NICOSIA)
</span><span class="cx"> 
</span><span class="cx"> #include "NicosiaPlatformLayer.h"
</span><del>-#include "ScrollAnimation.h"
</del><span class="cx"> #include "ScrollingEffectsController.h"
</span><span class="cx"> #include "ScrollingStateOverflowScrollingNode.h"
</span><span class="cx"> #include "ThreadedScrollingTree.h"
</span><span class="lines">@@ -39,7 +38,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// FIXME: This should not be a ScrollAnimationClient.
</del><span class="cx"> class ScrollingTreeScrollingNodeDelegateNicosia : public ScrollingTreeScrollingNodeDelegate, public ScrollingEffectsControllerClient {
</span><span class="cx"> public:
</span><span class="cx">     explicit ScrollingTreeScrollingNodeDelegateNicosia(ScrollingTreeScrollingNode&, bool scrollAnimatorEnabled);
</span><span class="lines">@@ -49,8 +47,11 @@
</span><span class="cx">     std::unique_ptr<Nicosia::SceneIntegration::UpdateScope> createUpdateScope();
</span><span class="cx">     void updateVisibleLengths();
</span><span class="cx">     WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, EventTargeting);
</span><del>-    void stopScrollAnimations();
</del><span class="cx"> 
</span><ins>+    // ScrollingTreeScrollingNodeDelegate
+    bool startAnimatedScrollToPosition(FloatPoint) final;
+    void stopAnimatedScroll() final;
+
</ins><span class="cx"> private:
</span><span class="cx">     void animationTimerFired();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollTypes.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollTypes.h      2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/platform/ScrollTypes.h 2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -305,6 +305,14 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><ins>+template<> struct EnumTraits<WebCore::ScrollIsAnimated> {
+    using values = EnumValues<
+        WebCore::ScrollIsAnimated,
+        WebCore::ScrollIsAnimated::No,
+        WebCore::ScrollIsAnimated::Yes
+    >;
+};
+
</ins><span class="cx"> template<> struct EnumTraits<WebCore::ScrollbarMode> {
</span><span class="cx">     using values = EnumValues<
</span><span class="cx">         WebCore::ScrollbarMode,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -523,12 +523,16 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (scrollAnimationStatus() == ScrollAnimationStatus::Animating)
</del><ins>+    if (scrollAnimationStatus() == ScrollAnimationStatus::Animating) {
</ins><span class="cx">         scrollAnimator().cancelAnimations();
</span><ins>+        stopAsyncAnimatedScroll();
+    }
</ins><span class="cx"> 
</span><span class="cx">     ScrollPosition newScrollPosition = (!delegatesScrolling() && options.clamping == ScrollClamping::Clamped) ? adjustScrollPositionWithinRange(scrollPosition) : scrollPosition;
</span><del>-    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && newScrollPosition == this->scrollPosition())
</del><ins>+    if ((!delegatesScrolling() || currentScrollType() == ScrollType::User) && newScrollPosition == this->scrollPosition()) {
+        LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition << " return for no change");
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (!requestScrollPositionUpdate(newScrollPosition, currentScrollType(), options.clamping))
</span><span class="cx">         updateScrollbars(newScrollPosition);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp    2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -140,10 +140,15 @@
</span><span class="cx">     scrollAnimator().scrollToPositionWithoutAnimation(position, clamping);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollableArea::scrollToPositionWithAnimation(const FloatPoint& position, ScrollClamping)
</del><ins>+void ScrollableArea::scrollToPositionWithAnimation(const FloatPoint& position, ScrollClamping clamping)
</ins><span class="cx"> {
</span><span class="cx">     LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToPositionWithAnimation " << position);
</span><del>-    if (scrollAnimator().scrollToPositionWithAnimation(position))
</del><ins>+
+    bool startedAnimation = requestAnimatedScrollToPosition(roundedIntPoint(position), clamping);
+    if (!startedAnimation)
+        startedAnimation = scrollAnimator().scrollToPositionWithAnimation(position);
+
+    if (startedAnimation)
</ins><span class="cx">         setScrollAnimationStatus(ScrollAnimationStatus::Animating);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h   2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/platform/ScrollableArea.h      2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -83,6 +83,8 @@
</span><span class="cx">     // returns true, the scrollable area won't actually update the scroll position and instead
</span><span class="cx">     // expect it to happen sometime in the future.
</span><span class="cx">     virtual bool requestScrollPositionUpdate(const ScrollPosition&, ScrollType = ScrollType::User, ScrollClamping = ScrollClamping::Clamped) { return false; }
</span><ins>+    virtual bool requestAnimatedScrollToPosition(const ScrollPosition&, ScrollClamping = ScrollClamping::Clamped) { return false; }
+    virtual void stopAsyncAnimatedScroll() { }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT virtual bool handleWheelEventForScrolling(const PlatformWheelEvent&, std::optional<WheelScrollGestureState>);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -254,6 +254,27 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderLayerScrollableArea::requestAnimatedScrollToPosition(const ScrollPosition& destinationPosition, ScrollClamping clamping)
+{
+#if ENABLE(ASYNC_SCROLLING)
+    LOG_WITH_STREAM(Scrolling, stream << m_layer << " requestAnimatedScrollToPosition " << destinationPosition);
+
+    if (auto* scrollingCoordinator = m_layer.page().scrollingCoordinator())
+        return scrollingCoordinator->requestAnimatedScrollToPosition(*this, destinationPosition, clamping);
+#endif
+    return false;
+}
+
+void RenderLayerScrollableArea::stopAsyncAnimatedScroll()
+{
+#if ENABLE(ASYNC_SCROLLING)
+    LOG_WITH_STREAM(Scrolling, stream << m_layer << " stopAsyncAnimatedScroll");
+
+    if (auto* scrollingCoordinator = m_layer.page().scrollingCoordinator())
+        return scrollingCoordinator->stopAnimatedScroll(*this);
+#endif
+}
+
</ins><span class="cx"> ScrollOffset RenderLayerScrollableArea::scrollToOffset(const ScrollOffset& scrollOffset, const ScrollPositionChangeOptions& options)
</span><span class="cx"> {
</span><span class="cx">     if (scrollAnimationStatus() == ScrollAnimationStatus::Animating)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h       2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.h  2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -200,6 +200,8 @@
</span><span class="cx">     IntSize reachableTotalContentsSize() const final;
</span><span class="cx"> 
</span><span class="cx">     bool requestScrollPositionUpdate(const ScrollPosition&, ScrollType = ScrollType::User, ScrollClamping = ScrollClamping::Clamped) final;
</span><ins>+    bool requestAnimatedScrollToPosition(const ScrollPosition&, ScrollClamping = ScrollClamping::Clamped) final;
+    void stopAsyncAnimatedScroll() final;
</ins><span class="cx"> 
</span><span class="cx">     bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayScrollbars; }
</span><span class="cx">     void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDirtyOverlayScrollbars = dirtyScrollbars; }
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebKit/ChangeLog       2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-10-07  Simon Fraser  <simon.fraser@apple.com>
+
+        Add some plumbing for running smooth scroll animations in the scrolling thread/UI process
+        https://bugs.webkit.org/show_bug.cgi?id=231402
+
+        Reviewed by Tim Horton.
+
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<RequestedScrollData>::encode):
+        (ArgumentCoder<RequestedScrollData>::decode):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
+        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::startAnimatedScrollToPosition):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::stopAnimatedScroll):
+
</ins><span class="cx"> 2021-10-07  Myles C. Maxfield  <mmaxfield@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [GPU Process] Unique RenderingResourceIdentifiers Part 2: Unroll PendingWakeupInformation::arguments
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteScrollingCoordinatorTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp     2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp        2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -507,6 +507,7 @@
</span><span class="cx">     encoder << scrollData.scrollPosition;
</span><span class="cx">     encoder << scrollData.scrollType;
</span><span class="cx">     encoder << scrollData.clamping;
</span><ins>+    encoder << scrollData.animated;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ArgumentCoder<RequestedScrollData>::decode(Decoder& decoder, RequestedScrollData& scrollData)
</span><span class="lines">@@ -520,6 +521,9 @@
</span><span class="cx">     if (!decoder.decode(scrollData.clamping))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(scrollData.animated))
+        return false;
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm    2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm       2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -94,10 +94,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Update the scroll position after child nodes have been updated, because they need to have updated their constraints before any scrolling happens.
</span><del>-    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
-        const auto& requestedScrollData = scrollingStateNode.requestedScrollData();
-        scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
-    }
</del><ins>+    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition))
+        handleScrollPositionRequest(scrollingStateNode.requestedScrollData());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatPoint ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition() const
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h        2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h   2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -79,6 +79,9 @@
</span><span class="cx">     UIScrollView *scrollView() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    bool startAnimatedScrollToPosition(FloatPoint) final;
+    void stopAnimatedScroll() final;
+
</ins><span class="cx">     RetainPtr<CALayer> m_scrollLayer;
</span><span class="cx">     RetainPtr<CALayer> m_scrolledContentsLayer;
</span><span class="cx">     RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (283791 => 283792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm       2021-10-08 02:03:00 UTC (rev 283791)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm  2021-10-08 04:30:33 UTC (rev 283792)
</span><span class="lines">@@ -289,12 +289,22 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::Property::RequestedScrollPosition)) {
</span><del>-        const auto& requestedScrollData = scrollingStateNode.requestedScrollData();
-        scrollingNode().scrollTo(requestedScrollData.scrollPosition, requestedScrollData.scrollType, requestedScrollData.clamping);
</del><ins>+        scrollingNode().handleScrollPositionRequest(scrollingStateNode.requestedScrollData());
</ins><span class="cx">         scrollingTree().setNeedsApplyLayerPositionsAfterCommit();
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeScrollingNodeDelegateIOS::startAnimatedScrollToPosition(FloatPoint)
+{
+    // FIXME: Implement.
+    return false;
+}
+
+void ScrollingTreeScrollingNodeDelegateIOS::stopAnimatedScroll()
+{
+    // FIXME: Implement.
+}
+
</ins><span class="cx"> #if HAVE(UISCROLLVIEW_ASYNCHRONOUS_SCROLL_EVENT_HANDLING)
</span><span class="cx"> void ScrollingTreeScrollingNodeDelegateIOS::handleAsynchronousCancelableScrollEvent(UIScrollView *scrollView, UIScrollEvent *scrollEvent, void (^completion)(BOOL handled))
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>