<!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>[282798] trunk/Source/WebCore</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/282798">282798</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2021-09-20 21:01:10 -0700 (Mon, 20 Sep 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Wrap ScrollingMomentumCalculator in a ScrollAnimationMomentum when used for scroll snap
https://bugs.webkit.org/show_bug.cgi?id=230506

Reviewed by Wenson Hsieh.

The long-term goal is to have all scroll animations run via ScrollAnimation subclasses,
and for there to be a class (ScrollAnimator or ScrollingEffectsController) that has
a member variable for the single active scroll animation, for there can be only one
at a time.

As a step towards that goal, make ScrollAnimationMomentum and have it wrap the
ScrollingMomentumCalculator. ScrollSnapAnimatorState then owns a ScrollAnimationMomentum.

Other ScrollAnimations are running their own timers (which should go away in future),
but for now ScrollAnimationMomentum is driven "manually" by ScrollSnapAnimatorState.
Facilitate this by having ScrollAnimation::serviceAnimation() return the current offset.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/ScrollAnimation.h:
(WebCore::ScrollAnimationClient::scrollAnimationDidUpdate):
(WebCore::ScrollAnimationClient::scrollAnimationDidEnd):
(WebCore::ScrollAnimation::serviceAnimation):
* platform/ScrollAnimationMomentum.cpp: Added.
(WebCore::ScrollAnimationMomentum::ScrollAnimationMomentum):
(WebCore::ScrollAnimationMomentum::startAnimatedScrollWithInitialVelocity):
(WebCore::ScrollAnimationMomentum::retargetActiveAnimation):
(WebCore::ScrollAnimationMomentum::stop):
(WebCore::ScrollAnimationMomentum::isActive const):
(WebCore::ScrollAnimationMomentum::serviceAnimation):
(WebCore::ScrollAnimationMomentum::updateScrollExtents):
* platform/ScrollAnimationMomentum.h: Added.
* platform/ScrollAnimationSmooth.cpp:
* platform/ScrollSnapAnimatorState.cpp:
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
(WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset const):
(WebCore::ScrollSnapAnimatorState::scrollExtentsForAnimation):
* platform/ScrollSnapAnimatorState.h:
* platform/ScrollingEffectsController.cpp:
* platform/ScrollingEffectsController.h:
* platform/mac/ScrollingEffectsController.mm:
(WebCore::ScrollingEffectsController::statelessSnapTransitionTimerFired):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimationh">trunk/Source/WebCore/platform/ScrollAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimationSmoothcpp">trunk/Source/WebCore/platform/ScrollAnimationSmooth.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollSnapAnimatorStatecpp">trunk/Source/WebCore/platform/ScrollSnapAnimatorState.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollSnapAnimatorStateh">trunk/Source/WebCore/platform/ScrollSnapAnimatorState.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollingEffectsControllercpp">trunk/Source/WebCore/platform/ScrollingEffectsController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollingEffectsControllerh">trunk/Source/WebCore/platform/ScrollingEffectsController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollingEffectsControllermm">trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformScrollAnimationMomentumcpp">trunk/Source/WebCore/platform/ScrollAnimationMomentum.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimationMomentumh">trunk/Source/WebCore/platform/ScrollAnimationMomentum.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/ChangeLog      2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2021-09-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Wrap ScrollingMomentumCalculator in a ScrollAnimationMomentum when used for scroll snap
+        https://bugs.webkit.org/show_bug.cgi?id=230506
+
+        Reviewed by Wenson Hsieh.
+
+        The long-term goal is to have all scroll animations run via ScrollAnimation subclasses,
+        and for there to be a class (ScrollAnimator or ScrollingEffectsController) that has
+        a member variable for the single active scroll animation, for there can be only one
+        at a time.
+
+        As a step towards that goal, make ScrollAnimationMomentum and have it wrap the 
+        ScrollingMomentumCalculator. ScrollSnapAnimatorState then owns a ScrollAnimationMomentum.
+
+        Other ScrollAnimations are running their own timers (which should go away in future),
+        but for now ScrollAnimationMomentum is driven "manually" by ScrollSnapAnimatorState.
+        Facilitate this by having ScrollAnimation::serviceAnimation() return the current offset.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/ScrollAnimation.h:
+        (WebCore::ScrollAnimationClient::scrollAnimationDidUpdate):
+        (WebCore::ScrollAnimationClient::scrollAnimationDidEnd):
+        (WebCore::ScrollAnimation::serviceAnimation):
+        * platform/ScrollAnimationMomentum.cpp: Added.
+        (WebCore::ScrollAnimationMomentum::ScrollAnimationMomentum):
+        (WebCore::ScrollAnimationMomentum::startAnimatedScrollWithInitialVelocity):
+        (WebCore::ScrollAnimationMomentum::retargetActiveAnimation):
+        (WebCore::ScrollAnimationMomentum::stop):
+        (WebCore::ScrollAnimationMomentum::isActive const):
+        (WebCore::ScrollAnimationMomentum::serviceAnimation):
+        (WebCore::ScrollAnimationMomentum::updateScrollExtents):
+        * platform/ScrollAnimationMomentum.h: Added.
+        * platform/ScrollAnimationSmooth.cpp:
+        * platform/ScrollSnapAnimatorState.cpp:
+        (WebCore::ScrollSnapAnimatorState::setupAnimationForState):
+        (WebCore::ScrollSnapAnimatorState::teardownAnimationForState):
+        (WebCore::ScrollSnapAnimatorState::currentAnimatedScrollOffset const):
+        (WebCore::ScrollSnapAnimatorState::scrollExtentsForAnimation):
+        * platform/ScrollSnapAnimatorState.h:
+        * platform/ScrollingEffectsController.cpp:
+        * platform/ScrollingEffectsController.h:
+        * platform/mac/ScrollingEffectsController.mm:
+        (WebCore::ScrollingEffectsController::statelessSnapTransitionTimerFired):
+
</ins><span class="cx"> 2021-09-20  Nikos Mouchtaris  <nmouchtaris@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Implement exp,log functions calc functions
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/Headers.cmake  2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -1132,6 +1132,7 @@
</span><span class="cx">     platform/SSLKeyGenerator.h
</span><span class="cx">     platform/ScreenProperties.h
</span><span class="cx">     platform/ScriptExecutionContextIdentifier.h
</span><ins>+    platform/ScrollAnimationMomentum.h
</ins><span class="cx">     platform/ScrollAnimator.h
</span><span class="cx">     platform/ScrollTypes.h
</span><span class="cx">     platform/ScrollView.h
</span><span class="lines">@@ -1139,7 +1140,6 @@
</span><span class="cx">     platform/Scrollbar.h
</span><span class="cx">     platform/ScrollbarTheme.h
</span><span class="cx">     platform/ScrollbarThemeComposite.h
</span><del>-    platform/ScrollingMomentumCalculator.h
</del><span class="cx">     platform/SearchPopupMenu.h
</span><span class="cx">     platform/SerializedPlatformDataCue.h
</span><span class="cx">     platform/SerializedPlatformDataCueValue.h
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/Sources.txt    2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -1823,6 +1823,7 @@
</span><span class="cx"> platform/RuntimeApplicationChecks.cpp
</span><span class="cx"> platform/SSLKeyGenerator.cpp
</span><span class="cx"> platform/ScrollAnimationKinetic.cpp
</span><ins>+platform/ScrollAnimationMomentum.cpp
</ins><span class="cx"> platform/ScrollAnimationSmooth.cpp
</span><span class="cx"> platform/ScrollAnimator.cpp
</span><span class="cx"> platform/ScrollingEffectsController.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -290,6 +290,7 @@
</span><span class="cx">          0F03C0741884695E00A5F8CA /* SystemMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F03C0731884695E00A5F8CA /* SystemMemory.h */; };
</span><span class="cx">          0F03C0751884805500A5F8CA /* InspectorOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C522D4A15B478B2009B7C95 /* InspectorOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F099D0917B968A100FF84B9 /* WebCoreTypedArrayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               0F0E009C26F92D8400ACE9C6 /* ScrollAnimationMomentum.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0E009A26F92D7B00ACE9C6 /* ScrollAnimationMomentum.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           0F11781822E3C47F008BD570 /* FrameIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F11781622E3C47E008BD570 /* FrameIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F11A54F0F39233100C37884 /* RenderSelectionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F13163E16ED0CC80035CC04 /* PlatformCAFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -350,7 +351,7 @@
</span><span class="cx">          0F94B6522209150600157014 /* ScrollingStatePositionedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94B651220914FF00157014 /* ScrollingStatePositionedNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F94B655220931E400157014 /* ScrollingTreePositionedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94B6532209156C00157014 /* ScrollingTreePositionedNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          0F94F37E23661626003AA5C7 /* StyleRuleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94F37C23661131003AA5C7 /* StyleRuleType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               0F99059A26F6BE850054FBE0 /* ScrollingMomentumCalculator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F99059926F6BE7F0054FBE0 /* ScrollingMomentumCalculator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                0F99059A26F6BE850054FBE0 /* ScrollingMomentumCalculator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F99059926F6BE7F0054FBE0 /* ScrollingMomentumCalculator.h */; };
</ins><span class="cx">           0F99059D26F6BE9A0054FBE0 /* ScrollingMomentumCalculatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F99059B26F6BE940054FBE0 /* ScrollingMomentumCalculatorMac.h */; };
</span><span class="cx">          0F9DAA0F1FD1C66A0079C5B2 /* DOMGCOutputConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9DAA0E1FD1C6640079C5B2 /* DOMGCOutputConstraint.h */; };
</span><span class="cx">          0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6184,6 +6185,8 @@
</span><span class="cx">          0F03C0731884695E00A5F8CA /* SystemMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemMemory.h; sourceTree = "<group>"; };
</span><span class="cx">          0F099D0617B968A100FF84B9 /* WebCoreTypedArrayController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreTypedArrayController.cpp; sourceTree = "<group>"; };
</span><span class="cx">          0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreTypedArrayController.h; sourceTree = "<group>"; };
</span><ins>+               0F0E009A26F92D7B00ACE9C6 /* ScrollAnimationMomentum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollAnimationMomentum.h; sourceTree = "<group>"; };
+               0F0E009B26F92D7B00ACE9C6 /* ScrollAnimationMomentum.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimationMomentum.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           0F11781622E3C47E008BD570 /* FrameIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameIdentifier.h; sourceTree = "<group>"; };
</span><span class="cx">          0F11A54E0F39233100C37884 /* RenderSelectionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSelectionInfo.h; sourceTree = "<group>"; };
</span><span class="cx">          0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAFilters.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -28145,6 +28148,8 @@
</span><span class="cx">                          0FA61B0C26F43212001AADB6 /* ScrollAnimation.h */,
</span><span class="cx">                          0FC692BC257C0F410098E3F9 /* ScrollAnimationKinetic.cpp */,
</span><span class="cx">                          0FC692BA257C0F400098E3F9 /* ScrollAnimationKinetic.h */,
</span><ins>+                               0F0E009B26F92D7B00ACE9C6 /* ScrollAnimationMomentum.cpp */,
+                               0F0E009A26F92D7B00ACE9C6 /* ScrollAnimationMomentum.h */,
</ins><span class="cx">                           0FC692BD257C0F410098E3F9 /* ScrollAnimationSmooth.cpp */,
</span><span class="cx">                          0FC692BE257C0F420098E3F9 /* ScrollAnimationSmooth.h */,
</span><span class="cx">                          CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */,
</span><span class="lines">@@ -34931,6 +34936,7 @@
</span><span class="cx">                          BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */,
</span><span class="cx">                          5D925B680F64D4DD00B847F0 /* ScrollAlignment.h in Headers */,
</span><span class="cx">                          0FA61B0E26F43213001AADB6 /* ScrollAnimation.h in Headers */,
</span><ins>+                               0F0E009C26F92D8400ACE9C6 /* ScrollAnimationMomentum.h in Headers */,
</ins><span class="cx">                           CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
</span><span class="cx">                          0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */,
</span><span class="cx">                          BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimation.h (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimation.h  2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollAnimation.h     2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ScrollTypes.h"
</span><span class="cx"> #include <wtf/FastMalloc.h>
</span><ins>+#include <wtf/MonotonicTime.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -38,8 +39,8 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~ScrollAnimationClient() = default;
</span><span class="cx"> 
</span><del>-    virtual void scrollAnimationDidUpdate(ScrollAnimation&, const FloatPoint& currentOffset) = 0;
-    virtual void scrollAnimationDidEnd(ScrollAnimation&) = 0;
</del><ins>+    virtual void scrollAnimationDidUpdate(ScrollAnimation&, const FloatPoint& /* currentOffset */) { }
+    virtual void scrollAnimationDidEnd(ScrollAnimation&) { }
</ins><span class="cx">     virtual ScrollExtents scrollExtentsForAnimation(ScrollAnimation&) = 0;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -56,8 +57,8 @@
</span><span class="cx">     virtual bool isActive() const = 0;
</span><span class="cx">     virtual void updateScrollExtents() { };
</span><span class="cx">     
</span><del>-    // FIXME: No-op. Need to use this instead of subclasses having timers.
-    virtual void serviceAnimation() { };
</del><ins>+    // Returns current offset.
+    virtual FloatPoint serviceAnimation(MonotonicTime) { return { }; };
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     ScrollAnimationClient& m_client;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimationMomentumcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ScrollAnimationMomentum.cpp (0 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimationMomentum.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/ScrollAnimationMomentum.cpp   2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -0,0 +1,118 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScrollAnimationMomentum.h"
+
+#include "Logging.h"
+#include "ScrollingMomentumCalculator.h"
+#include <wtf/text/TextStream.h>
+
+namespace WebCore {
+
+ScrollAnimationMomentum::ScrollAnimationMomentum(ScrollAnimationClient& client)
+    : ScrollAnimation(client)
+{
+}
+
+ScrollAnimationMomentum::~ScrollAnimationMomentum() = default;
+
+bool ScrollAnimationMomentum::startAnimatedScrollWithInitialVelocity(const FloatPoint& initialOffset, const FloatSize& initialVelocity, const FloatSize& initialDelta, const WTF::Function<FloatPoint(const FloatPoint&)>& destinationModifier)
+{
+    auto extents = m_client.scrollExtentsForAnimation(*this);
+
+    m_momentumCalculator = ScrollingMomentumCalculator::create(extents, initialOffset, initialDelta, initialVelocity);
+    auto predictedScrollOffset = m_momentumCalculator->predictedDestinationOffset();
+
+    if (destinationModifier) {
+        predictedScrollOffset = destinationModifier(predictedScrollOffset);
+        m_momentumCalculator->setRetargetedScrollOffset(predictedScrollOffset);
+    }
+
+    if (predictedScrollOffset == initialOffset) {
+        m_momentumCalculator = nullptr;
+        m_animationComplete = true;
+        return false;
+    }
+
+    m_startTime = MonotonicTime::now();
+    m_animationComplete = false;
+    return true;
+}
+
+bool ScrollAnimationMomentum::retargetActiveAnimation(const FloatPoint& newDestination)
+{
+    if (m_momentumCalculator) {
+        m_momentumCalculator->setRetargetedScrollOffset(newDestination);
+        auto newDuration = m_momentumCalculator->animationDuration();
+        m_animationComplete = newDuration > 0_s;
+        return !m_animationComplete;
+    }
+    return false;
+}
+
+void ScrollAnimationMomentum::stop()
+{
+    m_momentumCalculator = nullptr;
+    m_animationComplete = true;
+    m_client.scrollAnimationDidEnd(*this);
+}
+
+bool ScrollAnimationMomentum::isActive() const
+{
+    return !m_animationComplete;
+}
+
+FloatPoint ScrollAnimationMomentum::serviceAnimation(MonotonicTime currentTime)
+{
+    if (!m_momentumCalculator) {
+        ASSERT_NOT_REACHED();
+        return { };
+    }
+
+    auto elapsedTime = currentTime - m_startTime;
+    m_animationComplete = elapsedTime >= m_momentumCalculator->animationDuration();
+    auto newOffset = m_momentumCalculator->scrollOffsetAfterElapsedTime(elapsedTime);
+
+    m_client.scrollAnimationDidUpdate(*this, newOffset);
+
+    if (m_animationComplete)
+        m_client.scrollAnimationDidEnd(*this);
+    
+    return newOffset;
+}
+
+void ScrollAnimationMomentum::updateScrollExtents()
+{
+    auto extents = m_client.scrollExtentsForAnimation(*this);
+    auto predictedScrollOffset = m_momentumCalculator->predictedDestinationOffset();
+    auto constrainedOffset = predictedScrollOffset.constrainedBetween(extents.minimumScrollOffset(), extents.maximumScrollOffset());
+    if (constrainedOffset != predictedScrollOffset) {
+        retargetActiveAnimation(constrainedOffset);
+        if (m_animationComplete)
+            m_client.scrollAnimationDidEnd(*this);
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimationMomentumh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ScrollAnimationMomentum.h (0 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimationMomentum.h                          (rev 0)
+++ trunk/Source/WebCore/platform/ScrollAnimationMomentum.h     2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ScrollAnimation.h"
+
+namespace WebCore {
+
+class ScrollingMomentumCalculator;
+
+class ScrollAnimationMomentum final : public ScrollAnimation {
+public:
+    ScrollAnimationMomentum(ScrollAnimationClient&);
+    virtual ~ScrollAnimationMomentum();
+
+    bool startAnimatedScrollWithInitialVelocity(const FloatPoint& initialOffset, const FloatSize& initialVelocity, const FloatSize& initialDelta, const WTF::Function<FloatPoint(const FloatPoint&)>& destinationModifier);
+
+    bool retargetActiveAnimation(const FloatPoint& newDestination) final;
+    void stop() final;
+    bool isActive() const final;
+    FloatPoint serviceAnimation(MonotonicTime) final;
+    void updateScrollExtents() final;
+
+private:
+    std::unique_ptr<ScrollingMomentumCalculator> m_momentumCalculator;
+    
+    MonotonicTime m_startTime;
+    bool m_animationComplete { false };
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimationSmoothcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimationSmooth.cpp (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimationSmooth.cpp  2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollAnimationSmooth.cpp     2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -39,7 +39,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static const double frameRate = 60;
</ins><span class="cx"> static const float animationSpeed { 1000.0f };
</span><ins>+static constexpr Seconds minimumTimerInterval { 1_ms };
</ins><span class="cx"> static const Seconds maxAnimationDuration { 200_ms };
</span><span class="cx"> 
</span><span class="cx"> ScrollAnimationSmooth::ScrollAnimationSmooth(ScrollAnimationClient& client)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollSnapAnimatorStatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollSnapAnimatorState.cpp (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollSnapAnimatorState.cpp        2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollSnapAnimatorState.cpp   2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -26,11 +26,14 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ScrollSnapAnimatorState.h"
</span><span class="cx"> 
</span><ins>+#include "ScrollAnimationMomentum.h"
</ins><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/text/TextStream.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+ScrollSnapAnimatorState::~ScrollSnapAnimatorState() = default;
+
</ins><span class="cx"> bool ScrollSnapAnimatorState::transitionToSnapAnimationState(const ScrollExtents& scrollExtents, float pageScale, const FloatPoint& initialOffset)
</span><span class="cx"> {
</span><span class="cx">     return setupAnimationForState(ScrollSnapState::Snapping, scrollExtents, pageScale, initialOffset, { }, { });
</span><span class="lines">@@ -47,21 +50,26 @@
</span><span class="cx">     if (m_currentState == state)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    m_momentumCalculator = ScrollingMomentumCalculator::create(scrollExtents, initialOffset, initialDelta, initialVelocity);
-    FloatPoint predictedScrollTarget { m_momentumCalculator->predictedDestinationOffset() };
</del><ins>+    m_scrollExtents = scrollExtents;
</ins><span class="cx"> 
</span><del>-    float targetOffsetX, targetOffsetY;
-    std::tie(targetOffsetX, m_activeSnapIndexX) = targetOffsetForStartOffset(ScrollEventAxis::Horizontal, scrollExtents, initialOffset.x(), predictedScrollTarget, pageScale, initialDelta.width());
-    std::tie(targetOffsetY, m_activeSnapIndexY) = targetOffsetForStartOffset(ScrollEventAxis::Vertical, scrollExtents, initialOffset.y(), predictedScrollTarget, pageScale, initialDelta.height());
-    auto targetOffset = FloatPoint { targetOffsetX, targetOffsetY };
-    m_momentumCalculator->setRetargetedScrollOffset(targetOffset);
</del><ins>+    if (m_momentumScrollAnimation)
+        m_momentumScrollAnimation->stop();
</ins><span class="cx"> 
</span><del>-    if (targetOffset == initialOffset)
</del><ins>+    m_momentumScrollAnimation = WTF::makeUnique<ScrollAnimationMomentum>(*this);
+    bool animating = m_momentumScrollAnimation->startAnimatedScrollWithInitialVelocity(initialOffset, initialVelocity, initialDelta, [&](const FloatPoint& targetOffset) {
+        float targetOffsetX, targetOffsetY;
+        std::tie(targetOffsetX, m_activeSnapIndexX) = targetOffsetForStartOffset(ScrollEventAxis::Horizontal, scrollExtents, initialOffset.x(), targetOffset, pageScale, initialDelta.width());
+        std::tie(targetOffsetY, m_activeSnapIndexY) = targetOffsetForStartOffset(ScrollEventAxis::Vertical, scrollExtents, initialOffset.y(), targetOffset, pageScale, initialDelta.height());
+
+        return FloatPoint { targetOffsetX, targetOffsetY };
+    });
+
+    if (!animating)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     m_startTime = MonotonicTime::now();
</span><span class="cx">     m_currentState = state;
</span><del>-    return true;
</del><ins>+    return animating;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollSnapAnimatorState::transitionToUserInteractionState()
</span><span class="lines">@@ -80,21 +88,22 @@
</span><span class="cx">     if (m_currentState == state)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_momentumCalculator = nullptr;
-    m_startTime = MonotonicTime();
</del><ins>+    m_momentumScrollAnimation = nullptr;
+    m_startTime = { };
</ins><span class="cx">     m_currentState = state;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatPoint ScrollSnapAnimatorState::currentAnimatedScrollOffset(MonotonicTime currentTime, bool& isAnimationComplete) const
</span><span class="cx"> {
</span><del>-    if (!m_momentumCalculator) {
</del><ins>+    if (!m_momentumScrollAnimation) {
</ins><span class="cx">         isAnimationComplete = true;
</span><span class="cx">         return { };
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Seconds elapsedTime = currentTime - m_startTime;
-    isAnimationComplete = elapsedTime >= m_momentumCalculator->animationDuration();
-    return m_momentumCalculator->scrollOffsetAfterElapsedTime(elapsedTime);
</del><ins>+    auto currentOffset = m_momentumScrollAnimation->serviceAnimation(currentTime);
+    isAnimationComplete = !m_momentumScrollAnimation->isActive();
+
+    return currentOffset;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::pair<float, std::optional<unsigned>> ScrollSnapAnimatorState::targetOffsetForStartOffset(ScrollEventAxis axis, const ScrollExtents& scrollExtents, float startOffset, FloatPoint predictedOffset, float pageScale, float initialDelta) const
</span><span class="lines">@@ -111,6 +120,11 @@
</span><span class="cx">     return std::make_pair(pageScale * clampTo<float>(float { targetOffset }, minScrollOffset, maxScrollOffset), snapIndex);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ScrollExtents ScrollSnapAnimatorState::scrollExtentsForAnimation(ScrollAnimation&)
+{
+    return m_scrollExtents;
+}
+
</ins><span class="cx"> TextStream& operator<<(TextStream& ts, const ScrollSnapAnimatorState& state)
</span><span class="cx"> {
</span><span class="cx">     ts << "ScrollSnapAnimatorState";
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollSnapAnimatorStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollSnapAnimatorState.h (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollSnapAnimatorState.h  2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollSnapAnimatorState.h     2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -29,9 +29,9 @@
</span><span class="cx"> #include "FloatSize.h"
</span><span class="cx"> #include "LayoutPoint.h"
</span><span class="cx"> #include "PlatformWheelEvent.h"
</span><ins>+#include "ScrollAnimationMomentum.h"
</ins><span class="cx"> #include "ScrollSnapOffsetsInfo.h"
</span><span class="cx"> #include "ScrollTypes.h"
</span><del>-#include "ScrollingMomentumCalculator.h"
</del><span class="cx"> #include <wtf/MonotonicTime.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -47,11 +47,11 @@
</span><span class="cx">     UserInteraction
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-struct ScrollExtents;
-
-class ScrollSnapAnimatorState {
</del><ins>+class ScrollSnapAnimatorState : public ScrollAnimationClient {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><ins>+    virtual ~ScrollSnapAnimatorState();
+
</ins><span class="cx">     const Vector<SnapOffset<LayoutUnit>>& snapOffsetsForAxis(ScrollEventAxis axis) const
</span><span class="cx">     {
</span><span class="cx">         return axis == ScrollEventAxis::Horizontal ? m_snapOffsetsInfo.horizontalSnapOffsets : m_snapOffsetsInfo.verticalSnapOffsets;
</span><span class="lines">@@ -90,15 +90,20 @@
</span><span class="cx">     bool setupAnimationForState(ScrollSnapState, const ScrollExtents&, float pageScale, const FloatPoint& initialOffset, const FloatSize& initialVelocity, const FloatSize& initialDelta);
</span><span class="cx">     void teardownAnimationForState(ScrollSnapState);
</span><span class="cx"> 
</span><ins>+    // ScrollAnimationClient.
+    ScrollExtents scrollExtentsForAnimation(ScrollAnimation&) final;
+
</ins><span class="cx">     ScrollSnapState m_currentState { ScrollSnapState::UserInteraction };
</span><span class="cx"> 
</span><span class="cx">     LayoutScrollSnapOffsetsInfo m_snapOffsetsInfo;
</span><ins>+    
+    ScrollExtents m_scrollExtents;
</ins><span class="cx"> 
</span><span class="cx">     std::optional<unsigned> m_activeSnapIndexX;
</span><span class="cx">     std::optional<unsigned> m_activeSnapIndexY;
</span><span class="cx"> 
</span><span class="cx">     MonotonicTime m_startTime;
</span><del>-    std::unique_ptr<ScrollingMomentumCalculator> m_momentumCalculator;
</del><ins>+    std::unique_ptr<ScrollAnimationMomentum> m_momentumScrollAnimation;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WTF::TextStream& operator<<(WTF::TextStream&, const ScrollSnapAnimatorState&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollingEffectsControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.cpp (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollingEffectsController.cpp     2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.cpp        2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "LayoutSize.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PlatformWheelEvent.h"
</span><del>-#include "ScrollSnapAnimatorState.h"
</del><span class="cx"> #include "ScrollableArea.h"
</span><span class="cx"> #include "WheelEventTestMonitor.h"
</span><span class="cx"> #include <wtf/text/TextStream.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollingEffectsControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.h (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollingEffectsController.h       2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.h  2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> class KeyboardScrollingAnimator;
</span><span class="cx"> class LayoutSize;
</span><span class="cx"> class PlatformWheelEvent;
</span><ins>+class ScrollSnapAnimatorState;
</ins><span class="cx"> class ScrollingEffectsController;
</span><span class="cx"> class ScrollableArea;
</span><span class="cx"> class WheelEventTestMonitor;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollingEffectsControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm (282797 => 282798)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm  2021-09-21 01:51:09 UTC (rev 282797)
+++ trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm     2021-09-21 04:01:10 UTC (rev 282798)
</span><span class="lines">@@ -666,8 +666,8 @@
</span><span class="cx">     if (!usesScrollSnap())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_scrollSnapState->transitionToSnapAnimationState(m_client.scrollExtents(), m_client.pageScaleFactor(), m_client.scrollOffset());
-    startScrollSnapAnimation();
</del><ins>+    if (m_scrollSnapState->transitionToSnapAnimationState(m_client.scrollExtents(), m_client.pageScaleFactor(), m_client.scrollOffset()))
+        startScrollSnapAnimation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingEffectsController::startDeferringWheelEventTestCompletionDueToScrollSnapping()
</span></span></pre>
</div>
</div>

</body>
</html>