<!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>[285526] 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/285526">285526</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2021-11-09 13:06:00 -0800 (Tue, 09 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add runtime flag for momentum scrolling
https://bugs.webkit.org/show_bug.cgi?id=232898
<rdar://problem/85211338>

Reviewed by Simon Fraser.

* Scripts/Preferences/WebPreferencesInternal.yaml:
Add the preference.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
(WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
* platform/ScrollingEffectsController.h:
(WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFScriptsPreferencesWebPreferencesInternalyaml">trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreecpp">trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeh">trunk/Source/WebCore/page/scrolling/ScrollingTree.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="#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="#trunkSourceWebCoreplatformScrollingEffectsControllerh">trunk/Source/WebCore/platform/ScrollingEffectsController.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WTF/ChangeLog  2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-11-09  Tim Horton  <timothy_horton@apple.com>
+
+        Add runtime flag for momentum scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=232898
+        <rdar://problem/85211338>
+
+        Reviewed by Simon Fraser.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+        Add the preference.
+
</ins><span class="cx"> 2021-11-09  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r271735): PaymentShippingOption.selected ignored
</span></span></pre></div>
<a id="trunkSourceWTFScriptsPreferencesWebPreferencesInternalyaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml 2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml    2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -536,6 +536,21 @@
</span><span class="cx">     WebCore:
</span><span class="cx">       default: false
</span><span class="cx"> 
</span><ins>+MomentumScrollingAnimatorEnabled:
+  type: bool
+  humanReadableName: "Momentum Scrolling Animator"
+  humanReadableDescription: "Drive momentum scrolling via an internal animator instead of using momentum events"
+  defaultValue:
+    WebKitLegacy:
+      "PLATFORM(MAC)": true
+      default: false
+    WebKit:
+      "PLATFORM(MAC)": true
+      default: false
+    WebCore:
+      "PLATFORM(MAC)": true
+      default: false
+
</ins><span class="cx"> MouseEventsSimulationEnabled:
</span><span class="cx">   type: bool
</span><span class="cx">   humanReadableName: "Mouse events simulation"
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/ChangeLog      2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2021-11-09  Tim Horton  <timothy_horton@apple.com>
+
+        Add runtime flag for momentum scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=232898
+        <rdar://problem/85211338>
+
+        Reviewed by Simon Fraser.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+        (WebCore::ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled):
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/ScrollingStateNode.h:
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::commitTreeState):
+        * page/scrolling/ScrollingTree.h:
+        (WebCore::ScrollingTree::momentumScrollingAnimatorEnabled const):
+        (WebCore::ScrollingTree::setMomentumScrollingAnimatorEnabled):
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled const):
+        * page/scrolling/ScrollingTreeScrollingNode.h:
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
+        * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled const):
+        * platform/ScrollingEffectsController.h:
+        (WebCore::ScrollingEffectsControllerClient::momentumScrollingAnimatorEnabled const):
+
</ins><span class="cx"> 2021-11-09  Don Olmstead  <don.olmstead@sony.com>
</span><span class="cx"> 
</span><span class="cx">         Fix !ENABLE(ACCESSIBILITY) after r285427
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp   2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -746,6 +746,7 @@
</span><span class="cx">     frameScrollingNode.setAsyncFrameOrOverflowScrollingEnabled(settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled());
</span><span class="cx">     frameScrollingNode.setScrollingPerformanceTestingEnabled(settings.scrollingPerformanceTestingEnabled());
</span><span class="cx">     frameScrollingNode.setWheelEventGesturesBecomeNonBlocking(settings.wheelEventGesturesBecomeNonBlocking());
</span><ins>+    frameScrollingNode.setMomentumScrollingAnimatorEnabled(settings.momentumScrollingAnimatorEnabled());
</ins><span class="cx"> 
</span><span class="cx">     frameScrollingNode.setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
</span><span class="cx">     frameScrollingNode.setMaxLayoutViewportOrigin(frameView.maxStableLayoutViewportOrigin());
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp    2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     , m_asyncFrameOrOverflowScrollingEnabled(stateNode.asyncFrameOrOverflowScrollingEnabled())
</span><span class="cx">     , m_wheelEventGesturesBecomeNonBlocking(stateNode.wheelEventGesturesBecomeNonBlocking())
</span><span class="cx">     , m_scrollingPerformanceTestingEnabled(stateNode.scrollingPerformanceTestingEnabled())
</span><ins>+    , m_momentumScrollingAnimatorEnabled(stateNode.momentumScrollingAnimatorEnabled())
</ins><span class="cx"> {
</span><span class="cx">     if (hasChangedProperty(Property::RootContentsLayer))
</span><span class="cx">         setRootContentsLayer(stateNode.rootContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
</span><span class="lines">@@ -112,6 +113,7 @@
</span><span class="cx">         Property::MinLayoutViewportOrigin,
</span><span class="cx">         Property::MaxLayoutViewportOrigin,
</span><span class="cx">         Property::OverrideVisualViewportSize,
</span><ins>+        Property::MomentumScrollingAnimatorEnabled,
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     auto properties = ScrollingStateScrollingNode::applicableProperties();
</span><span class="lines">@@ -309,6 +311,15 @@
</span><span class="cx">     setPropertyChanged(Property::ScrollingPerformanceTestingEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollingStateFrameScrollingNode::setMomentumScrollingAnimatorEnabled(bool enabled)
+{
+    if (enabled == m_momentumScrollingAnimatorEnabled)
+        return;
+    
+    m_momentumScrollingAnimatorEnabled = enabled;
+    setPropertyChanged(Property::MomentumScrollingAnimatorEnabled);
+}
+
</ins><span class="cx"> void ScrollingStateFrameScrollingNode::dumpProperties(TextStream& ts, OptionSet<ScrollingStateTreeAsTextBehavior> behavior) const
</span><span class="cx"> {
</span><span class="cx">     ts << "Frame scrolling node";
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h   2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h      2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -117,6 +117,9 @@
</span><span class="cx">     bool wheelEventGesturesBecomeNonBlocking() const { return m_wheelEventGesturesBecomeNonBlocking; }
</span><span class="cx">     WEBCORE_EXPORT void setWheelEventGesturesBecomeNonBlocking(bool);
</span><span class="cx"> 
</span><ins>+    bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; }
+    WEBCORE_EXPORT void setMomentumScrollingAnimatorEnabled(bool);
+
</ins><span class="cx">     void dumpProperties(WTF::TextStream&, OptionSet<ScrollingStateTreeAsTextBehavior>) const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -149,6 +152,7 @@
</span><span class="cx">     bool m_asyncFrameOrOverflowScrollingEnabled { false };
</span><span class="cx">     bool m_wheelEventGesturesBecomeNonBlocking { false };
</span><span class="cx">     bool m_scrollingPerformanceTestingEnabled { false };
</span><ins>+    bool m_momentumScrollingAnimatorEnabled { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h 2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h    2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -255,19 +255,20 @@
</span><span class="cx">         FixedElementsLayoutRelativeToFrame          = 1LLU << 31,
</span><span class="cx">         VisualViewportIsSmallerThanLayoutViewport   = 1LLU << 32,
</span><span class="cx">         AsyncFrameOrOverflowScrollingEnabled        = 1LLU << 33,
</span><del>-        WheelEventGesturesBecomeNonBlocking         = 1LLU << 34,
-        ScrollingPerformanceTestingEnabled          = 1LLU << 35,
-        LayoutViewport                              = 1LLU << 36,
-        MinLayoutViewportOrigin                     = 1LLU << 37,
-        MaxLayoutViewportOrigin                     = 1LLU << 38,
-        OverrideVisualViewportSize                  = 1LLU << 39,
</del><ins>+        MomentumScrollingAnimatorEnabled            = 1LLU << 34,
+        WheelEventGesturesBecomeNonBlocking         = 1LLU << 35,
+        ScrollingPerformanceTestingEnabled          = 1LLU << 36,
+        LayoutViewport                              = 1LLU << 37,
+        MinLayoutViewportOrigin                     = 1LLU << 38,
+        MaxLayoutViewportOrigin                     = 1LLU << 39,
+        OverrideVisualViewportSize                  = 1LLU << 40,
</ins><span class="cx">         // ScrollingStatePositionedNode
</span><del>-        RelatedOverflowScrollingNodes               = 1LLU << 40,
-        LayoutConstraintData                        = 1LLU << 41,
</del><ins>+        RelatedOverflowScrollingNodes               = 1LLU << 41,
+        LayoutConstraintData                        = 1LLU << 42,
</ins><span class="cx">         // ScrollingStateFixedNode, ScrollingStateStickyNode
</span><del>-        ViewportConstraints                         = 1LLU << 42,
</del><ins>+        ViewportConstraints                         = 1LLU << 43,
</ins><span class="cx">         // ScrollingStateOverflowScrollProxyNode
</span><del>-        OverflowScrollingNode                       = 1LLU << 43,
</del><ins>+        OverflowScrollingNode                       = 1LLU << 44,
</ins><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     bool hasChangedProperties() const { return !m_changedProperties.isEmpty(); }
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp    2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp       2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -279,7 +279,8 @@
</span><span class="cx">             || rootNode->hasChangedProperty(ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled)
</span><span class="cx">             || rootNode->hasChangedProperty(ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking)
</span><span class="cx">             || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled)
</span><del>-            || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))) {
</del><ins>+            || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents)
+            || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))) {
</ins><span class="cx">         Locker locker { m_treeStateLock };
</span><span class="cx"> 
</span><span class="cx">         if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::ScrolledContentsLayer))
</span><span class="lines">@@ -299,6 +300,9 @@
</span><span class="cx"> 
</span><span class="cx">         if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::IsMonitoringWheelEvents))
</span><span class="cx">             m_isMonitoringWheelEvents = scrollingStateTree->rootStateNode()->isMonitoringWheelEvents();
</span><ins>+
+        if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled))
+            m_momentumScrollingAnimatorEnabled = scrollingStateTree->rootStateNode()->momentumScrollingAnimatorEnabled();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_overflowRelatedNodesMap.clear();
</span><span class="lines">@@ -320,6 +324,9 @@
</span><span class="cx">         if (auto node = m_nodeMap.take(nodeID))
</span><span class="cx">             node->willBeDestroyed();
</span><span class="cx">     }
</span><ins>+
+    if (rootNode && (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled)))
+        RELEASE_LOG(Scrolling, "ScrollingTree momentum scrolling animator enabled: %d", rootNode->momentumScrollingAnimatorEnabled());
</ins><span class="cx">     
</span><span class="cx">     didCommitTree();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h      2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -100,6 +100,9 @@
</span><span class="cx">     bool scrollingPerformanceTestingEnabled() const { return m_scrollingPerformanceTestingEnabled; }
</span><span class="cx">     void setScrollingPerformanceTestingEnabled(bool value) { m_scrollingPerformanceTestingEnabled = value; }
</span><span class="cx"> 
</span><ins>+    bool momentumScrollingAnimatorEnabled() const { return m_momentumScrollingAnimatorEnabled; }
+    void setMomentumScrollingAnimatorEnabled(bool value) { m_momentumScrollingAnimatorEnabled = value; }
+
</ins><span class="cx">     WEBCORE_EXPORT OptionSet<WheelEventProcessingSteps> determineWheelEventProcessing(const PlatformWheelEvent&);
</span><span class="cx">     WEBCORE_EXPORT virtual WheelEventHandlingResult handleWheelEvent(const PlatformWheelEvent&, OptionSet<WheelEventProcessingSteps> = { });
</span><span class="cx"> 
</span><span class="lines">@@ -331,6 +334,7 @@
</span><span class="cx">     bool m_scrollingPerformanceTestingEnabled { false };
</span><span class="cx">     bool m_asyncFrameOrOverflowScrollingEnabled { false };
</span><span class="cx">     bool m_wheelEventGesturesBecomeNonBlocking { false };
</span><ins>+    bool m_momentumScrollingAnimatorEnabled { false };
</ins><span class="cx">     bool m_needsApplyLayerPositionsAfterCommit { false };
</span><span class="cx">     bool m_inCommitTreeState { false };
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp       2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp  2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -225,6 +225,11 @@
</span><span class="cx">     scrollingTree().setNodeScrollSnapInProgress(scrollingNodeID(), isSnapping);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeScrollingNode::momentumScrollingAnimatorEnabled() const
+{
+    return scrollingTree().momentumScrollingAnimatorEnabled();
+}
+
</ins><span class="cx"> void ScrollingTreeScrollingNode::willStartAnimatedScroll()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h    2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -132,6 +132,8 @@
</span><span class="cx"> 
</span><span class="cx">     void willStartAnimatedScroll();
</span><span class="cx">     void didStopAnimatedScroll();
</span><ins>+
+    bool momentumScrollingAnimatorEnabled() const;
</ins><span class="cx">     
</span><span class="cx">     void setScrollAnimationInProgress(bool);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h  2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h     2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -93,6 +93,8 @@
</span><span class="cx">     void rubberBandingStateChanged(bool) final;
</span><span class="cx">     void adjustScrollPositionToBoundsIfNecessary() final;
</span><span class="cx"> 
</span><ins>+    bool momentumScrollingAnimatorEnabled() const final;
+
</ins><span class="cx">     bool scrollPositionIsNotRubberbandingEdge(const FloatPoint&) const;
</span><span class="cx"> 
</span><span class="cx">     FloatPoint scrollOffset() const final;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeScrollingNodeDelegateMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm 2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm    2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -442,6 +442,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollingTreeScrollingNodeDelegateMac::momentumScrollingAnimatorEnabled() const
+{
+    return scrollingNode().momentumScrollingAnimatorEnabled();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(MAC) && ENABLE(ASYNC_SCROLLING)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollingEffectsControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.h (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollingEffectsController.h       2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.h  2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -120,6 +120,8 @@
</span><span class="cx">     virtual float pageScaleFactor() const = 0;
</span><span class="cx">     virtual ScrollExtents scrollExtents() const = 0;
</span><span class="cx">     virtual bool scrollAnimationEnabled() const { return true; }
</span><ins>+
+    virtual bool momentumScrollingAnimatorEnabled() const { return false; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class ScrollingEffectsController : public ScrollAnimationClient {
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebKit/ChangeLog       2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-11-09  Tim Horton  <timothy_horton@apple.com>
+
+        Add runtime flag for momentum scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=232898
+        <rdar://problem/85211338>
+
+        Reviewed by Simon Fraser.
+
+        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+
</ins><span class="cx"> 2021-11-09  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r271735): PaymentShippingOption.selected ignored
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteScrollingCoordinatorTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp (285525 => 285526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp     2021-11-09 20:49:41 UTC (rev 285525)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp        2021-11-09 21:06:00 UTC (rev 285526)
</span><span class="lines">@@ -149,6 +149,7 @@
</span><span class="cx">         WebCore::ScrollingStateNode::Property::FixedElementsLayoutRelativeToFrame,
</span><span class="cx">         WebCore::ScrollingStateNode::Property::VisualViewportIsSmallerThanLayoutViewport,
</span><span class="cx">         WebCore::ScrollingStateNode::Property::AsyncFrameOrOverflowScrollingEnabled,
</span><ins>+        WebCore::ScrollingStateNode::Property::MomentumScrollingAnimatorEnabled,
</ins><span class="cx">         WebCore::ScrollingStateNode::Property::WheelEventGesturesBecomeNonBlocking,
</span><span class="cx">         WebCore::ScrollingStateNode::Property::ScrollingPerformanceTestingEnabled,
</span><span class="cx">         WebCore::ScrollingStateNode::Property::LayoutViewport,
</span><span class="lines">@@ -251,6 +252,7 @@
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, minLayoutViewportOrigin)
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, maxLayoutViewportOrigin)
</span><span class="cx">     SCROLLING_NODE_ENCODE(ScrollingStateNode::Property::OverrideVisualViewportSize, overrideVisualViewportSize)
</span><ins>+    // MomentumScrollingAnimatorEnabled is not relevant for UI-side compositing.
</ins><span class="cx"> 
</span><span class="cx">     if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer))
</span><span class="cx">         encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
</span><span class="lines">@@ -365,6 +367,7 @@
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MinLayoutViewportOrigin, FloatPoint, setMinLayoutViewportOrigin)
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateNode::Property::MaxLayoutViewportOrigin, FloatPoint, setMaxLayoutViewportOrigin)
</span><span class="cx">     SCROLLING_NODE_DECODE(ScrollingStateNode::Property::OverrideVisualViewportSize, std::optional<FloatSize>, setOverrideVisualViewportSize)
</span><ins>+    // MomentumScrollingAnimatorEnabled is not encoded.
</ins><span class="cx"> 
</span><span class="cx">     if (node.hasChangedProperty(ScrollingStateNode::Property::CounterScrollingLayer)) {
</span><span class="cx">         GraphicsLayer::PlatformLayerID layerID;
</span></span></pre>
</div>
</div>

</body>
</html>