Title: [284302] trunk/Source/WebCore
Revision
284302
Author
[email protected]
Date
2021-10-15 20:03:52 -0700 (Fri, 15 Oct 2021)

Log Message

Rename some keyboard-scrolling-related functions on ScrollingEffectsController for clarity
https://bugs.webkit.org/show_bug.cgi?id=231842

Reviewed by Beth Dakin.

Rename beginKeyboardScrolling/stopKeyboardScrolling to willBegin and didStop to make
it clear that they are responding to KeyboardScrollingAnimator state changes.

Add the imperative ScrollingEffectsController::stopKeyboardScrolling() which will get
hooked up soon.

* platform/KeyboardScrollingAnimator.cpp:
(WebCore::KeyboardScrollingAnimator::updateKeyboardScrollPosition):
(WebCore::KeyboardScrollingAnimator::beginKeyboardScrollGesture):
* platform/ScrollingEffectsController.cpp:
(WebCore::ScrollingEffectsController::willBeginKeyboardScrolling):
(WebCore::ScrollingEffectsController::didStopKeyboardScrolling):
(WebCore::ScrollingEffectsController::stopKeyboardScrolling):
(WebCore::ScrollingEffectsController::beginKeyboardScrolling): Deleted.
* platform/ScrollingEffectsController.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (284301 => 284302)


--- trunk/Source/WebCore/ChangeLog	2021-10-16 02:59:03 UTC (rev 284301)
+++ trunk/Source/WebCore/ChangeLog	2021-10-16 03:03:52 UTC (rev 284302)
@@ -1,3 +1,26 @@
+2021-10-15  Simon Fraser  <[email protected]>
+
+        Rename some keyboard-scrolling-related functions on ScrollingEffectsController for clarity
+        https://bugs.webkit.org/show_bug.cgi?id=231842
+
+        Reviewed by Beth Dakin.
+
+        Rename beginKeyboardScrolling/stopKeyboardScrolling to willBegin and didStop to make
+        it clear that they are responding to KeyboardScrollingAnimator state changes.
+
+        Add the imperative ScrollingEffectsController::stopKeyboardScrolling() which will get
+        hooked up soon.
+
+        * platform/KeyboardScrollingAnimator.cpp:
+        (WebCore::KeyboardScrollingAnimator::updateKeyboardScrollPosition):
+        (WebCore::KeyboardScrollingAnimator::beginKeyboardScrollGesture):
+        * platform/ScrollingEffectsController.cpp:
+        (WebCore::ScrollingEffectsController::willBeginKeyboardScrolling):
+        (WebCore::ScrollingEffectsController::didStopKeyboardScrolling):
+        (WebCore::ScrollingEffectsController::stopKeyboardScrolling):
+        (WebCore::ScrollingEffectsController::beginKeyboardScrolling): Deleted.
+        * platform/ScrollingEffectsController.h:
+
 2021-10-15  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r284245.

Modified: trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp (284301 => 284302)


--- trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp	2021-10-16 02:59:03 UTC (rev 284301)
+++ trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp	2021-10-16 03:03:52 UTC (rev 284302)
@@ -140,7 +140,7 @@
     m_scrollAnimator.scrollToPositionWithoutAnimation(newPosition);
 
     if (!m_scrollTriggeringKeyIsPressed && m_velocity.diagonalLengthSquared() < 1) {
-        m_scrollController.stopKeyboardScrolling();
+        m_scrollController.didStopKeyboardScrolling();
         m_velocity = { };
     }
 }
@@ -279,7 +279,7 @@
     m_scrollTriggeringKeyIsPressed = true;
 
     m_idealPositionForMinimumTravel = m_scrollAnimator.currentPosition() + m_currentKeyboardScroll->offset;
-    m_scrollController.beginKeyboardScrolling();
+    m_scrollController.willBeginKeyboardScrolling();
 
     return true;
 }

Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.cpp (284301 => 284302)


--- trunk/Source/WebCore/platform/ScrollingEffectsController.cpp	2021-10-16 02:59:03 UTC (rev 284301)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.cpp	2021-10-16 03:03:52 UTC (rev 284302)
@@ -84,12 +84,12 @@
     m_isRunningAnimatingCallback = false;
 }
 
-void ScrollingEffectsController::beginKeyboardScrolling()
+void ScrollingEffectsController::willBeginKeyboardScrolling()
 {
     setIsAnimatingKeyboardScrolling(true);
 }
 
-void ScrollingEffectsController::stopKeyboardScrolling()
+void ScrollingEffectsController::didStopKeyboardScrolling()
 {
     setIsAnimatingKeyboardScrolling(false);
 }
@@ -168,6 +168,14 @@
     startOrStopAnimationCallbacks();
 }
 
+void ScrollingEffectsController::stopKeyboardScrolling()
+{
+    if (!m_isAnimatingKeyboardScrolling)
+        return;
+
+    m_client.keyboardScrollingAnimator()->handleKeyUpEvent();
+}
+
 void ScrollingEffectsController::contentsSizeChanged()
 {
     if (m_currentAnimation)

Modified: trunk/Source/WebCore/platform/ScrollingEffectsController.h (284301 => 284302)


--- trunk/Source/WebCore/platform/ScrollingEffectsController.h	2021-10-16 02:59:03 UTC (rev 284301)
+++ trunk/Source/WebCore/platform/ScrollingEffectsController.h	2021-10-16 03:03:52 UTC (rev 284302)
@@ -137,10 +137,12 @@
     bool retargetAnimatedScroll(FloatPoint newDestinationOffset);
     void stopAnimatedScroll();
 
+    void stopKeyboardScrolling();
+
     bool startMomentumScrollWithInitialVelocity(const FloatPoint& initialOffset, const FloatSize& initialVelocity, const FloatSize& initialDelta, const WTF::Function<FloatPoint(const FloatPoint&)>& destinationModifier);
 
-    void beginKeyboardScrolling();
-    void stopKeyboardScrolling();
+    void willBeginKeyboardScrolling();
+    void didStopKeyboardScrolling();
     
     // Should be called periodically by the client. Started by startAnimationCallback(), stopped by stopAnimationCallback().
     void animationCallback(MonotonicTime);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to