<!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>[286722] branches/safari-612.4.2.1-branch/Source/WebKit</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/286722">286722</a></dd>
<dt>Author</dt> <dd>alancoon@apple.com</dd>
<dt>Date</dt> <dd>2021-12-08 13:25:52 -0800 (Wed, 08 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/286380">r286380</a>. rdar://problem/85928816

    Unreviewed build fixes after <a href="http://trac.webkit.org/projects/webkit/changeset/286346">r286346</a>.

    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
    (WebKit::MomentumEventDispatcher::startDisplayLink):
    (WebKit::MomentumEventDispatcher::displayWasRefreshed):
    (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
    (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
    (WebKit::MomentumEventDispatcher::offsetAtTime):
    (WebKit::momentumDecayRate):
    (WebKit::MomentumEventDispatcher::computeNextDelta):
    * WebProcess/WebPage/MomentumEventDispatcher.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286380 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari612421branchSourceWebKitChangeLog">branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari612421branchSourceWebKitWebProcessWebPageMomentumEventDispatchercpp">branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp</a></li>
<li><a href="#branchessafari612421branchSourceWebKitWebProcessWebPageMomentumEventDispatcherh">branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari612421branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog (286721 => 286722)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog 2021-12-08 21:25:49 UTC (rev 286721)
+++ branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog    2021-12-08 21:25:52 UTC (rev 286722)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2021-12-03  Russell Epstein  <repstein@apple.com>
+
+        Cherry-pick r286380. rdar://problem/85928816
+
+    Unreviewed build fixes after r286346.
+    
+    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+    (WebKit::MomentumEventDispatcher::startDisplayLink):
+    (WebKit::MomentumEventDispatcher::displayWasRefreshed):
+    (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
+    (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
+    (WebKit::MomentumEventDispatcher::offsetAtTime):
+    (WebKit::momentumDecayRate):
+    (WebKit::MomentumEventDispatcher::computeNextDelta):
+    * WebProcess/WebPage/MomentumEventDispatcher.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-12-01  Chris Dumez  <cdumez@apple.com>
+
+            Unreviewed build fixes after r286346.
+
+            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+            (WebKit::MomentumEventDispatcher::startDisplayLink):
+            (WebKit::MomentumEventDispatcher::displayWasRefreshed):
+            (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
+            (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
+            (WebKit::MomentumEventDispatcher::offsetAtTime):
+            (WebKit::momentumDecayRate):
+            (WebKit::MomentumEventDispatcher::computeNextDelta):
+            * WebProcess/WebPage/MomentumEventDispatcher.h:
+
</ins><span class="cx"> 2021-12-01  Alan Coon  <alancoon@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Cherry-pick r286346. rdar://problem/85928816
</span></span></pre></div>
<a id="branchessafari612421branchSourceWebKitWebProcessWebPageMomentumEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286721 => 286722)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp    2021-12-08 21:25:49 UTC (rev 286721)
+++ branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp       2021-12-08 21:25:52 UTC (rev 286722)
</span><span class="lines">@@ -30,8 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include "EventDispatcher.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "WebProcess.h"
</ins><span class="cx"> #include "WebProcessProxyMessages.h"
</span><span class="cx"> #include <WebCore/DisplayRefreshMonitor.h>
</span><ins>+#include <WebCore/Scrollbar.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -221,7 +223,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Switch down to lower-than-full-speed frame rates for the tail end of the curve.
</span><del>-    WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, FullSpeedFramesPerSecond), 0);
</del><ins>+    WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, WebCore::FullSpeedFramesPerSecond), 0);
</ins><span class="cx">     RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher starting display link for display %d", displayID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -262,9 +264,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if !USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
</span><span class="cx">     // Intentional delta rounding (but at the end!).
</span><del>-    FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
</del><ins>+    WebCore::FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
</ins><span class="cx"> #else
</span><del>-    FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
</del><ins>+    WebCore::FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     dispatchSyntheticMomentumEvent(WebWheelEvent::PhaseChanged, -delta);
</span><span class="lines">@@ -272,7 +274,7 @@
</span><span class="cx">     m_currentGesture.currentOffset += delta;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MomentumEventDispatcher::didReceiveScrollEventWithInterval(FloatSize size, Seconds frameInterval)
</del><ins>+void MomentumEventDispatcher::didReceiveScrollEventWithInterval(WebCore::FloatSize size, Seconds frameInterval)
</ins><span class="cx"> {
</span><span class="cx">     auto push = [](HistoricalDeltas& deltas, Delta newDelta) {
</span><span class="cx">         bool directionChanged = deltas.size() && (deltas.first().rawPlatformDelta > 0) != (newDelta.rawPlatformDelta > 0);
</span><span class="lines">@@ -310,7 +312,7 @@
</span><span class="cx">     didReceiveScrollEventWithInterval(delta, frameInterval);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(FloatSize initialUnacceleratedDelta)
</del><ins>+void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(WebCore::FloatSize initialUnacceleratedDelta)
</ins><span class="cx"> {
</span><span class="cx"> #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
</span><span class="cx">     m_currentGesture.carryOffset = { };
</span><span class="lines">@@ -317,11 +319,11 @@
</span><span class="cx"> #endif
</span><span class="cx">     m_currentGesture.offsetTable.clear();
</span><span class="cx"> 
</span><del>-    FloatSize accumulatedOffset;
-    FloatSize unacceleratedDelta = initialUnacceleratedDelta;
</del><ins>+    WebCore::FloatSize accumulatedOffset;
+    WebCore::FloatSize unacceleratedDelta = initialUnacceleratedDelta;
</ins><span class="cx"> 
</span><span class="cx">     do {
</span><del>-        FloatSize acceleratedDelta;
</del><ins>+        WebCore::FloatSize acceleratedDelta;
</ins><span class="cx">         std::tie(unacceleratedDelta, acceleratedDelta) = computeNextDelta(unacceleratedDelta);
</span><span class="cx"> 
</span><span class="cx">         accumulatedOffset += acceleratedDelta;
</span><span class="lines">@@ -336,7 +338,7 @@
</span><span class="cx">     return a + t * (b - a);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
</del><ins>+WebCore::FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_currentGesture.offsetTable.size())
</span><span class="cx">         return { };
</span><span class="lines">@@ -352,7 +354,7 @@
</span><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float momentumDecayRate(FloatSize delta, Seconds frameInterval)
</del><ins>+static float momentumDecayRate(WebCore::FloatSize delta, Seconds frameInterval)
</ins><span class="cx"> {
</span><span class="cx">     constexpr float defaultDecay = 0.975f;
</span><span class="cx">     constexpr float tailVelocity = 250.f;
</span><span class="lines">@@ -373,9 +375,9 @@
</span><span class="cx">     return value / 65536.0f;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::pair<FloatSize, FloatSize> MomentumEventDispatcher::computeNextDelta(FloatSize currentUnacceleratedDelta)
</del><ins>+std::pair<WebCore::FloatSize, WebCore::FloatSize> MomentumEventDispatcher::computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta)
</ins><span class="cx"> {
</span><del>-    FloatSize unacceleratedDelta = currentUnacceleratedDelta;
</del><ins>+    WebCore::FloatSize unacceleratedDelta = currentUnacceleratedDelta;
</ins><span class="cx"> 
</span><span class="cx">     float decayRate = momentumDecayRate(unacceleratedDelta, idealCurveFrameRate);
</span><span class="cx">     unacceleratedDelta.scale(decayRate);
</span><span class="lines">@@ -445,7 +447,7 @@
</span><span class="cx">         return value * multiplier;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    FloatSize acceleratedDelta(
</del><ins>+    WebCore::FloatSize acceleratedDelta(
</ins><span class="cx">         accelerateAxis(m_deltaHistoryX, quantizedUnacceleratedDelta.width()),
</span><span class="cx">         accelerateAxis(m_deltaHistoryY, quantizedUnacceleratedDelta.height())
</span><span class="cx">     );
</span></span></pre></div>
<a id="branchessafari612421branchSourceWebKitWebProcessWebPageMomentumEventDispatcherh"></a>
<div class="modfile"><h4>Modified: branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h (286721 => 286722)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h      2021-12-08 21:25:49 UTC (rev 286721)
+++ branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h 2021-12-08 21:25:52 UTC (rev 286722)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #define USE_MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING 0
</span><span class="cx"> #define USE_MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING 1
</span><span class="cx"> 
</span><ins>+#include "DisplayLinkObserverID.h"
</ins><span class="cx"> #include "ScrollingAccelerationCurve.h"
</span><span class="cx"> #include "WebWheelEvent.h"
</span><span class="cx"> #include <WebCore/FloatSize.h>
</span><span class="lines">@@ -37,6 +38,7 @@
</span><span class="cx"> #include <WebCore/PageIdentifier.h>
</span><span class="cx"> #include <WebCore/RectEdges.h>
</span><span class="cx"> #include <memory>
</span><ins>+#include <wtf/Deque.h>
</ins><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -76,12 +78,12 @@
</span><span class="cx"> 
</span><span class="cx">     void dispatchSyntheticMomentumEvent(WebWheelEvent::Phase, WebCore::FloatSize delta);
</span><span class="cx"> 
</span><del>-    void buildOffsetTableWithInitialDelta(FloatSize);
</del><ins>+    void buildOffsetTableWithInitialDelta(WebCore::FloatSize);
</ins><span class="cx"> 
</span><del>-    FloatSize offsetAtTime(Seconds);
-    std::pair<FloatSize, FloatSize> computeNextDelta(FloatSize currentUnacceleratedDelta);
</del><ins>+    WebCore::FloatSize offsetAtTime(Seconds);
+    std::pair<WebCore::FloatSize, WebCore::FloatSize> computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta);
</ins><span class="cx"> 
</span><del>-    void didReceiveScrollEventWithInterval(FloatSize, Seconds);
</del><ins>+    void didReceiveScrollEventWithInterval(WebCore::FloatSize, Seconds);
</ins><span class="cx">     void didReceiveScrollEvent(const WebWheelEvent&);
</span><span class="cx"> 
</span><span class="cx">     struct Delta {
</span><span class="lines">@@ -97,7 +99,7 @@
</span><span class="cx">     std::optional<WebWheelEvent> m_lastIncomingEvent;
</span><span class="cx">     WebCore::RectEdges<bool> m_lastRubberBandableEdges;
</span><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><del>-    FloatSize m_lastActivePhaseDelta;
</del><ins>+    WebCore::FloatSize m_lastActivePhaseDelta;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     struct {
</span><span class="lines">@@ -107,18 +109,18 @@
</span><span class="cx">         std::optional<ScrollingAccelerationCurve> accelerationCurve;
</span><span class="cx">         std::optional<WebWheelEvent> initiatingEvent;
</span><span class="cx"> 
</span><del>-        FloatSize currentOffset;
</del><ins>+        WebCore::FloatSize currentOffset;
</ins><span class="cx">         WallTime startTime;
</span><span class="cx"> 
</span><del>-        Vector<FloatSize> offsetTable;
</del><ins>+        Vector<WebCore::FloatSize> offsetTable;
</ins><span class="cx"> 
</span><span class="cx"> #if !RELEASE_LOG_DISABLED
</span><del>-        FloatSize accumulatedEventOffset;
</del><ins>+        WebCore::FloatSize accumulatedEventOffset;
</ins><span class="cx">         bool didLogInitialQueueState { false };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
</span><del>-        FloatSize carryOffset;
</del><ins>+        WebCore::FloatSize carryOffset;
</ins><span class="cx"> #endif
</span><span class="cx">     } m_currentGesture;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>