Title: [286566] trunk/Source/WebKit
Revision
286566
Author
[email protected]
Date
2021-12-06 13:31:41 -0800 (Mon, 06 Dec 2021)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (286565 => 286566)


--- trunk/Source/WebKit/ChangeLog	2021-12-06 21:15:39 UTC (rev 286565)
+++ trunk/Source/WebKit/ChangeLog	2021-12-06 21:31:41 UTC (rev 286566)
@@ -1,3 +1,19 @@
+2021-12-06  Tim Horton  <[email protected]>
+
+        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-06  Brady Eidson  <[email protected]>
 
         Put webpushd code in WebKit.framework.

Modified: trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286565 => 286566)


--- trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-06 21:15:39 UTC (rev 286565)
+++ trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-06 21:31:41 UTC (rev 286566)
@@ -306,7 +306,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&)
@@ -478,10 +481,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);
@@ -502,6 +503,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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to