Title: [106026] trunk/Source/WebCore
Revision
106026
Author
ander...@apple.com
Date
2012-01-26 12:13:39 -0800 (Thu, 26 Jan 2012)

Log Message

Use PlatformWheelEvent::phase() to determine if a scroll gesture begins or ends
https://bugs.webkit.org/show_bug.cgi?id=77127

Reviewed by Beth Dakin.

* platform/mac/ScrollAnimatorMac.h:
(ScrollAnimatorMac):
Remove handleGestureEvent.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::handleWheelEvent):
Look at the event phase to determine when to call didBeginGesture and didEndGesture.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106025 => 106026)


--- trunk/Source/WebCore/ChangeLog	2012-01-26 20:09:40 UTC (rev 106025)
+++ trunk/Source/WebCore/ChangeLog	2012-01-26 20:13:39 UTC (rev 106026)
@@ -1,3 +1,18 @@
+2012-01-26  Anders Carlsson  <ander...@apple.com>
+
+        Use PlatformWheelEvent::phase() to determine if a scroll gesture begins or ends
+        https://bugs.webkit.org/show_bug.cgi?id=77127
+
+        Reviewed by Beth Dakin.
+
+        * platform/mac/ScrollAnimatorMac.h:
+        (ScrollAnimatorMac):
+        Remove handleGestureEvent.
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::handleWheelEvent):
+        Look at the event phase to determine when to call didBeginGesture and didEndGesture.
+
 2012-01-26  Benjamin Poulain  <benja...@webkit.org>
 
         Using strncmp() for comparing scheme and port numbers is inefficient

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h (106025 => 106026)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2012-01-26 20:09:40 UTC (rev 106025)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h	2012-01-26 20:13:39 UTC (rev 106026)
@@ -84,10 +84,7 @@
 
 #if ENABLE(RUBBER_BANDING)
     virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
-#if ENABLE(GESTURE_EVENTS)
-    virtual void handleGestureEvent(const PlatformGestureEvent&);
 #endif
-#endif
 
     virtual void cancelAnimations();
     virtual void setIsActive();

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (106025 => 106026)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2012-01-26 20:09:40 UTC (rev 106025)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2012-01-26 20:13:39 UTC (rev 106026)
@@ -950,15 +950,15 @@
         }
     }
 
-    return m_scrollElasticityController.handleWheelEvent(wheelEvent);
-}
-
-void ScrollAnimatorMac::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
-{
-    if (gestureEvent.type() == PlatformEvent::GestureScrollBegin)
+    if (wheelEvent.phase() == PlatformWheelEventPhaseBegan) {
+        // We don't return after this because we still want the scroll elasticity controller to handle the wheel event.
         beginScrollGesture();
-    else if (gestureEvent.type() == PlatformEvent::GestureScrollEnd)
+    } else if (wheelEvent.phase() == PlatformWheelEventPhaseEnded) {
         endScrollGesture();
+        return true;
+    }
+
+    return m_scrollElasticityController.handleWheelEvent(wheelEvent);
 }
 
 bool ScrollAnimatorMac::pinnedInDirection(float deltaX, float deltaY)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to