Title: [266235] trunk/Source/WebCore
Revision
266235
Author
simon.fra...@apple.com
Date
2020-08-27 09:37:10 -0700 (Thu, 27 Aug 2020)

Log Message

Remove startedGestureAtScrollLimit which is always false.

Modified Paths


Diff

Modified: trunk/Source/WebCore/ChangeLog (266234 => 266235)


--- trunk/Source/WebCore/ChangeLog	2020-08-27 15:54:17 UTC (rev 266234)
+++ trunk/Source/WebCore/ChangeLog	2020-08-27 16:37:10 UTC (rev 266235)
@@ -1,3 +1,21 @@
+2020-08-23  Simon Fraser  <simon.fra...@apple.com>
+
+        ScrollLatchingState::startedGestureAtScrollLimit() is always false; remove it
+        https://bugs.webkit.org/show_bug.cgi?id=215758
+
+        Reviewed by Darin Adler.
+
+        ScrollLatchingState::startedGestureAtScrollLimit() is initialized to false and never
+        set to true, so remove it.
+
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::determineWheelEventTarget):
+        (WebCore::EventHandler::processWheelEventForScrolling):
+        (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
+        * page/scrolling/ScrollLatchingState.cpp:
+        (WebCore::operator<<):
+        * page/scrolling/ScrollLatchingState.h:
+
 2020-08-27  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, address review comments for r266221 that I missed before landing.

Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (266234 => 266235)


--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2020-08-27 15:54:17 UTC (rev 266234)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2020-08-27 16:37:10 UTC (rev 266235)
@@ -993,7 +993,6 @@
             bool startingAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea.get(), wheelEvent.deltaX(), wheelEvent.deltaY());
             if (!startingAtScrollLimit) {
                 ScrollLatchingState latchingState;
-                latchingState.setStartedGestureAtScrollLimit(false);
                 latchingState.setWheelEventElement(wheelEventTarget.get());
                 latchingState.setFrame(&m_frame);
                 latchingState.setScrollableContainer(scrollableContainer.get());
@@ -1076,17 +1075,14 @@
         LOG_WITH_STREAM(ScrollLatching, stream << "  latching state " << *latchingState);
 
         // WebKit2 code path
-        if (!frameHasPlatformWidget(m_frame) && !latchingState->startedGestureAtScrollLimit() && scrollableContainer == latchingState->scrollableContainer() && scrollableArea && view != scrollableArea) {
+        if (!frameHasPlatformWidget(m_frame) && scrollableContainer == latchingState->scrollableContainer() && scrollableArea && view != scrollableArea) {
             // If we did not start at the scroll limit, do not pass the event on to be handled by enclosing scrollable regions.
             LOG_WITH_STREAM(Scrolling, stream << "EventHandler " << this << " processWheelEventForScrolling - latched to " << scrollableArea.get() << " and not propagating");
             return true;
         }
 
-        if (!latchingState->startedGestureAtScrollLimit()) {
-            // FIXME: This set 'view' to a FrameView that is not this EventHandler's FrameView, which then gets scrolled from here, which is wrong.
-            view = frameViewForLatchingState(m_frame, *latchingState);
-        }
-
+        // FIXME: This set 'view' to a FrameView that is not this EventHandler's FrameView, which then gets scrolled from here, which is wrong.
+        view = frameViewForLatchingState(m_frame, *latchingState);
         ASSERT(view);
 
         bool didHandleWheelEvent = view->wheelEvent(wheelEvent);
@@ -1093,7 +1089,7 @@
         if (scrollableContainer == latchingState->scrollableContainer()) {
             // If we are just starting a scroll event, and have nowhere left to scroll, allow
             // the enclosing frame to handle the scroll.
-            didHandleWheelEvent = !latchingState->startedGestureAtScrollLimit();
+            didHandleWheelEvent = true;
         }
 
         // If the platform widget is handling the event, we always want to return false.
@@ -1119,7 +1115,7 @@
         return false;
 
     if (wheelEvent.useLatchedEventElement() && latchingState->scrollableContainer() && scrollableContainer == latchingState->scrollableContainer())
-        return !latchingState->startedGestureAtScrollLimit();
+        return true;
 
     return false;
 }

Modified: trunk/Source/WebCore/page/scrolling/ScrollLatchingState.cpp (266234 => 266235)


--- trunk/Source/WebCore/page/scrolling/ScrollLatchingState.cpp	2020-08-27 15:54:17 UTC (rev 266234)
+++ trunk/Source/WebCore/page/scrolling/ScrollLatchingState.cpp	2020-08-27 16:37:10 UTC (rev 266235)
@@ -73,7 +73,6 @@
     multilineStream.dumpProperty("previousElement", state.previousWheelScrolledElement());
     multilineStream.dumpProperty("scrollable container", state.scrollableContainer());
     multilineStream.dumpProperty("widgetIsLatched", state.widgetIsLatched());
-    multilineStream.dumpProperty("started at limit", state.startedGestureAtScrollLimit());
 
     ts << "ScrollLatchingState " << multilineStream.release();
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollLatchingState.h (266234 => 266235)


--- trunk/Source/WebCore/page/scrolling/ScrollLatchingState.h	2020-08-27 15:54:17 UTC (rev 266234)
+++ trunk/Source/WebCore/page/scrolling/ScrollLatchingState.h	2020-08-27 16:37:10 UTC (rev 266235)
@@ -59,9 +59,6 @@
     ContainerNode* scrollableContainer() const { return m_scrollableContainer.get(); }
     void setScrollableContainer(ContainerNode*);
 
-    bool startedGestureAtScrollLimit() const { return m_startedGestureAtScrollLimit; }
-    void setStartedGestureAtScrollLimit(bool startedAtLimit) { m_startedGestureAtScrollLimit = startedAtLimit; }
-
 private:
     WeakPtr<Element> m_wheelEventElement;
     WeakPtr<Element> m_previousWheelScrolledElement;
@@ -70,7 +67,6 @@
     Frame* m_frame { nullptr };
 
     bool m_widgetIsLatched { false };
-    bool m_startedGestureAtScrollLimit { false };
 };
 
 WTF::TextStream& operator<<(WTF::TextStream&, const ScrollLatchingState&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to