Scroll snapping should trigger when receiving a momentum end wheel event
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:13:53 +0000 (18:13 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Aug 2015 18:13:53 +0000 (18:13 +0000)
commit6e4409d3f0a8720b026c26172c7c6af099a2a0f1
treeafad0ee179098ee692601f5c148039f191670c96
parentfffe90e093e193cf125eaf4e1c6f8ee805e6a2ff
Scroll snapping should trigger when receiving a momentum end wheel event
https://bugs.webkit.org/show_bug.cgi?id=148155

Reviewed by Alexey Proskuryakov.

No new tests, since the purpose of this patch is to get existing tests to pass when
allowing similar wheel events to coalesce. To accomplish this, we relax our assumption
that the user must have generated at least 3 momentum wheel events in order for the
gliding animation to trigger. Upon receiving a wheel event indicating the end of the
momentum phase, we now kick off the gliding animation as long as any momentum event
was tracked earlier in the gesture with a nonzero wheel delta.

* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Added logic to
    begin a glide animation if we have received a momentum end event but have not
    yet triggered a gliding animation.
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/cocoa/ScrollSnapAnimatorState.mm:
(WebCore::ScrollSnapAnimatorState::wheelDeltaTrackingIsInProgress): Minor refactoring
    to make the wheel event processing code more readable.
(WebCore::ScrollSnapAnimatorState::hasFinishedTrackingWheelDeltas): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.h
Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm