Title: [287997] trunk/Source/WebKit
Revision
287997
Author
[email protected]
Date
2022-01-13 15:44:28 -0800 (Thu, 13 Jan 2022)

Log Message

Sometimes cannot scroll after using internal trackpad
https://bugs.webkit.org/show_bug.cgi?id=235206
<rdar://problem/87274541>

Reviewed by Simon Fraser.

* WebProcess/WebPage/MomentumEventDispatcher.cpp:
(WebKit::MomentumEventDispatcher::didStartMomentumPhase):
(WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve):
* WebProcess/WebPage/MomentumEventDispatcher.h:
We store std::optional<ScrollingAccelerationCurve> in a map, but then
when looking at whether we have a curve (to decide whether or not to even
use MomentumEventDispatcher), we check if the map has *any* value for the
given page... even an unengaged optional. To fix, check if the optional is engaged.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (287996 => 287997)


--- trunk/Source/WebKit/ChangeLog	2022-01-13 23:19:39 UTC (rev 287996)
+++ trunk/Source/WebKit/ChangeLog	2022-01-13 23:44:28 UTC (rev 287997)
@@ -1,3 +1,20 @@
+2022-01-13  Tim Horton  <[email protected]>
+
+        Sometimes cannot scroll after using internal trackpad
+        https://bugs.webkit.org/show_bug.cgi?id=235206
+        <rdar://problem/87274541>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+        (WebKit::MomentumEventDispatcher::didStartMomentumPhase):
+        (WebKit::MomentumEventDispatcher::setScrollingAccelerationCurve):
+        * WebProcess/WebPage/MomentumEventDispatcher.h:
+        We store std::optional<ScrollingAccelerationCurve> in a map, but then
+        when looking at whether we have a curve (to decide whether or not to even
+        use MomentumEventDispatcher), we check if the map has *any* value for the
+        given page... even an unengaged optional. To fix, check if the optional is engaged.
+
 2022-01-13  Per Arne Vollan  <[email protected]>
 
         Avoid unnecessary call to windowScreenDidChange

Modified: trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (287996 => 287997)


--- trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2022-01-13 23:19:39 UTC (rev 287996)
+++ trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2022-01-13 23:44:28 UTC (rev 287997)
@@ -59,7 +59,8 @@
     if (event.momentumPhase() != WebWheelEvent::PhaseBegan)
         return false;
 
-    if (!m_accelerationCurves.contains(pageIdentifier)) {
+    auto curveIterator = m_accelerationCurves.find(pageIdentifier);
+    if (curveIterator == m_accelerationCurves.end() || !curveIterator->value) {
         RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher not using synthetic momentum phase: no acceleration curve");
         return false;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to