Title: [126556] trunk/Source/WebCore
Revision
126556
Author
[email protected]
Date
2012-08-24 01:40:51 -0700 (Fri, 24 Aug 2012)

Log Message

Get rid of m_useLatchedWheelEventNode
https://bugs.webkit.org/show_bug.cgi?id=94684

Reviewed by Ryosuke Niwa.

Moves the setting of m_useLatchedWheelEventNode into PlatformWheelEvent.

* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::defaultWheelEventHandler):
(WebCore::EventHandler::handleGestureScrollCore):
* page/EventHandler.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
(WebCore::PlatformWheelEvent::setUseLatchedEventNode):
(PlatformWheelEvent):
(WebCore::PlatformWheelEvent::hasPreciseScrollingDeltas):
(WebCore::PlatformWheelEvent::useLatchedEventNode):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126555 => 126556)


--- trunk/Source/WebCore/ChangeLog	2012-08-24 08:39:06 UTC (rev 126555)
+++ trunk/Source/WebCore/ChangeLog	2012-08-24 08:40:51 UTC (rev 126556)
@@ -1,3 +1,25 @@
+2012-08-24  Allan Sandfeld Jensen  <[email protected]>
+
+        Get rid of m_useLatchedWheelEventNode
+        https://bugs.webkit.org/show_bug.cgi?id=94684
+
+        Reviewed by Ryosuke Niwa.
+
+        Moves the setting of m_useLatchedWheelEventNode into PlatformWheelEvent.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        (WebCore::EventHandler::handleGestureScrollCore):
+        * page/EventHandler.h:
+        * platform/PlatformWheelEvent.h:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+        (WebCore::PlatformWheelEvent::setUseLatchedEventNode):
+        (PlatformWheelEvent):
+        (WebCore::PlatformWheelEvent::hasPreciseScrollingDeltas):
+        (WebCore::PlatformWheelEvent::useLatchedEventNode):
+
 2012-08-24  Yoshifumi Inoue  <[email protected]>
 
         [Forms] Multiple fields time input UI should handle Delete key as Backspace key

Modified: trunk/Source/WebCore/page/EventHandler.cpp (126555 => 126556)


--- trunk/Source/WebCore/page/EventHandler.cpp	2012-08-24 08:39:06 UTC (rev 126555)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2012-08-24 08:40:51 UTC (rev 126556)
@@ -308,7 +308,6 @@
     , m_eventHandlerWillResetCapturingMouseEventsNode(0)
     , m_clickCount(0)
     , m_mouseDownTimestamp(0)
-    , m_useLatchedWheelEventNode(false)
     , m_widgetIsLatched(false)
 #if PLATFORM(MAC)
     , m_mouseDownView(nil)
@@ -2299,11 +2298,9 @@
     HitTestResult result(vPoint);
     doc->renderView()->hitTest(request, result);
 
-#if PLATFORM(MAC)
-    m_useLatchedWheelEventNode = e.momentumPhase() == PlatformWheelEventPhaseBegan || e.momentumPhase() == PlatformWheelEventPhaseChanged;
-#endif
+    bool useLatchedWheelEventNode = e.useLatchedEventNode();
 
-    if (m_useLatchedWheelEventNode) {
+    if (useLatchedWheelEventNode) {
         if (!m_latchedWheelEventNode) {
             m_latchedWheelEventNode = result.innerNode();
             m_widgetIsLatched = result.isOverWidget();
@@ -2367,7 +2364,7 @@
     if (scrollNode(wheelEvent->rawDeltaY(), granularity, ScrollUp, ScrollDown, startNode, &stopNode))
         wheelEvent->setDefaultHandled();
     
-    if (!m_useLatchedWheelEventNode)
+    if (!m_latchedWheelEventNode)
         m_previousWheelScrolledNode = stopNode;
 }
 
@@ -2490,7 +2487,6 @@
 
 bool EventHandler::handleGestureScrollCore(const PlatformGestureEvent& gestureEvent, PlatformWheelEventGranularity granularity, bool latchedWheel)
 {
-    TemporaryChange<bool> latched(m_useLatchedWheelEventNode, latchedWheel);
     const float tickDivisor = (float)WheelEvent::tickMultiplier;
     IntPoint point(gestureEvent.position().x(), gestureEvent.position().y());
     IntPoint globalPoint(gestureEvent.globalPosition().x(), gestureEvent.globalPosition().y());
@@ -2498,6 +2494,7 @@
         gestureEvent.deltaX(), gestureEvent.deltaY(), gestureEvent.deltaX() / tickDivisor, gestureEvent.deltaY() / tickDivisor,
         granularity,
         gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
+    syntheticWheelEvent.setUseLatchedEventNode(latchedWheel);
     return handleWheelEvent(syntheticWheelEvent);
 }
 #endif

Modified: trunk/Source/WebCore/page/EventHandler.h (126555 => 126556)


--- trunk/Source/WebCore/page/EventHandler.h	2012-08-24 08:39:06 UTC (rev 126555)
+++ trunk/Source/WebCore/page/EventHandler.h	2012-08-24 08:40:51 UTC (rev 126556)
@@ -430,7 +430,6 @@
     double m_mouseDownTimestamp;
     PlatformMouseEvent m_mouseDown;
 
-    bool m_useLatchedWheelEventNode;
     RefPtr<Node> m_latchedWheelEventNode;
     bool m_widgetIsLatched;
 

Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (126555 => 126556)


--- trunk/Source/WebCore/platform/PlatformWheelEvent.h	2012-08-24 08:39:06 UTC (rev 126555)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h	2012-08-24 08:40:51 UTC (rev 126556)
@@ -87,6 +87,7 @@
             , m_wheelTicksY(0)
             , m_granularity(ScrollByPixelWheelEvent)
             , m_directionInvertedFromDevice(false)
+            , m_useLatchedEventNode(false)
 #if PLATFORM(MAC) || PLATFORM(CHROMIUM)
             , m_hasPreciseScrollingDeltas(false)
 #endif
@@ -110,11 +111,12 @@
             , m_wheelTicksY(wheelTicksY)
             , m_granularity(granularity)
             , m_directionInvertedFromDevice(false)
+            , m_useLatchedEventNode(false)
 #if PLATFORM(MAC) || PLATFORM(CHROMIUM)
             , m_hasPreciseScrollingDeltas(false)
 #endif
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-           , m_phase(PlatformWheelEventPhaseNone)
+            , m_phase(PlatformWheelEventPhaseNone)
             , m_momentumPhase(PlatformWheelEventPhaseNone)
             , m_scrollCount(0)
             , m_unacceleratedScrollingDeltaX(0)
@@ -148,6 +150,8 @@
 
         bool directionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
 
+        void setUseLatchedEventNode(bool b) { m_useLatchedEventNode = b; }
+
 #if PLATFORM(GTK)
         explicit PlatformWheelEvent(GdkEventScroll*);
 #endif
@@ -157,7 +161,7 @@
 #endif
 
 #if PLATFORM(MAC) || PLATFORM(CHROMIUM)
-       bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
+        bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
 #endif
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
         PlatformWheelEventPhase phase() const { return m_phase; }
@@ -165,6 +169,9 @@
         unsigned scrollCount() const { return m_scrollCount; }
         float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; }
         float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; }
+        bool useLatchedEventNode() const { return m_useLatchedEventNode || (m_momentumPhase == PlatformWheelEventPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged); }
+#else
+        bool useLatchedEventNode() const { return m_useLatchedEventNode; }
 #endif
 
 #if PLATFORM(WIN)
@@ -189,11 +196,12 @@
         float m_wheelTicksY;
         PlatformWheelEventGranularity m_granularity;
         bool m_directionInvertedFromDevice;
+        bool m_useLatchedEventNode;
 #if PLATFORM(MAC) || PLATFORM(CHROMIUM)
         bool m_hasPreciseScrollingDeltas;
 #endif
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
-         PlatformWheelEventPhase m_phase;
+        PlatformWheelEventPhase m_phase;
         PlatformWheelEventPhase m_momentumPhase;
         unsigned m_scrollCount;
         float m_unacceleratedScrollingDeltaX;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to