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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106026
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-26 Anders Carlsson <andersca@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 <benjamin@webkit.org>
Using strncmp() for comparing scheme and port numbers is inefficient
#if ENABLE(RUBBER_BANDING)
virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
-#if ENABLE(GESTURE_EVENTS)
- virtual void handleGestureEvent(const PlatformGestureEvent&);
-#endif
#endif
virtual void cancelAnimations();
}
}
- 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)