REGRESSION (r184296): View keeps scrolling upward
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2015 19:29:33 +0000 (19:29 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2015 19:29:33 +0000 (19:29 +0000)
commita422589ca37be987f7009076355737e85a6bc45b
treea89d29ba08f38f1eb4ee16aded023301c40c2d8e
parent3c77b4e0d7056186af32746a5839033a687a6ee7
REGRESSION (r184296): View keeps scrolling upward
https://bugs.webkit.org/show_bug.cgi?id=146497
<rdar://problem/21524942>

Reviewed by Darin Adler.

Avoid improperly triggering the ScrollController wheel event handling
logic when the wheel event deltaX/deltaY are zero. On certain sites,
this caused a programmatic JavaScript scroll to be triggered unexpectedly,
scrolling the page back to some initial state.

This bug was introduced while trying to make sure scrollbars were notified
when the wheel event had come to an end. Revise that change so that we still
follow the right code path for non-stretchable regions. However, make sure
that for zero-delta wheel events we make sure to properly handle the wheel
event phase.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): New helper function
to reduce the complexity of the logic in handleWheelEvent.
(WebCore::ScrollAnimatorMac::handleWheelEvent): When wheel events should be forwarded
to the parent scroll view, if the event was handled or has no change in position
trigger the 'handleWheelEventPhase' logic so that scrollbars are hidden, etc.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm