Title: [286674] branches/safari-613.1.11-branch/Source/WebKit
Revision
286674
Author
repst...@apple.com
Date
2021-12-08 12:17:26 -0800 (Wed, 08 Dec 2021)

Log Message

Cherry-pick r286566. rdar://problem/86223477

    Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled
    https://bugs.webkit.org/show_bug.cgi?id=233894
    <rdar://problem/86111948>

    Reviewed by Simon Fraser.

    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
    (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime):
    Only flip the deltas if the trackpad is configured to use "natural"
    scrolling (in which "directionInvertedFromDevice" is true).

    (WebKit::MomentumEventDispatcher::computeNextDelta):
    Fix initial queue state logging to log both axes before setting the "did log" bit.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613.1.11-branch/Source/WebKit/ChangeLog (286673 => 286674)


--- branches/safari-613.1.11-branch/Source/WebKit/ChangeLog	2021-12-08 20:04:20 UTC (rev 286673)
+++ branches/safari-613.1.11-branch/Source/WebKit/ChangeLog	2021-12-08 20:17:26 UTC (rev 286674)
@@ -1,3 +1,40 @@
+2021-12-08  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r286566. rdar://problem/86223477
+
+    Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled
+    https://bugs.webkit.org/show_bug.cgi?id=233894
+    <rdar://problem/86111948>
+    
+    Reviewed by Simon Fraser.
+    
+    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+    (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime):
+    Only flip the deltas if the trackpad is configured to use "natural"
+    scrolling (in which "directionInvertedFromDevice" is true).
+    
+    (WebKit::MomentumEventDispatcher::computeNextDelta):
+    Fix initial queue state logging to log both axes before setting the "did log" bit.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-12-06  Tim Horton  <timothy_hor...@apple.com>
+
+            Momentum Event Dispatcher: Momentum phase runs backwards with natural scrolling disabled
+            https://bugs.webkit.org/show_bug.cgi?id=233894
+            <rdar://problem/86111948>
+
+            Reviewed by Simon Fraser.
+
+            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+            (WebKit::MomentumEventDispatcher::consumeDeltaForCurrentTime):
+            Only flip the deltas if the trackpad is configured to use "natural"
+            scrolling (in which "directionInvertedFromDevice" is true).
+
+            (WebKit::MomentumEventDispatcher::computeNextDelta):
+            Fix initial queue state logging to log both axes before setting the "did log" bit.
+
 2021-12-07  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r286563. rdar://problem/86175400

Modified: branches/safari-613.1.11-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286673 => 286674)


--- branches/safari-613.1.11-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-08 20:04:20 UTC (rev 286673)
+++ branches/safari-613.1.11-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-08 20:17:26 UTC (rev 286674)
@@ -300,7 +300,10 @@
 
     m_currentGesture.currentOffset += delta;
 
-    return -delta;
+    if (m_currentGesture.initiatingEvent->directionInvertedFromDevice())
+        delta.scale(-1);
+
+    return delta;
 }
 
 void MomentumEventDispatcher::displayWasRefreshed(WebCore::PlatformDisplayID displayID, const WebCore::DisplayUpdate&)
@@ -472,10 +475,8 @@
         float averageDelta = totalDelta / count;
 
 #if ENABLE(MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING)
-        if (!m_currentGesture.didLogInitialQueueState) {
+        if (!m_currentGesture.didLogInitialQueueState)
             RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher initial historical deltas: average delta %f, average time %fms, event count %d", averageDelta, averageFrameIntervalMS, count);
-            m_currentGesture.didLogInitialQueueState = true;
-        }
 #endif
 
         constexpr float velocityGainA = fromFixedPoint(2.f);
@@ -496,6 +497,10 @@
         accelerateAxis(m_deltaHistoryY, quantizedUnacceleratedDelta.height())
     );
 
+#if ENABLE(MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING)
+    m_currentGesture.didLogInitialQueueState = true;
+#endif
+
     return { unacceleratedDelta, acceleratedDelta };
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to