REGRESSION (r173484): Reducing content of scrollable region does not reset scroll
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 18:26:16 +0000 (18:26 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 18:26:16 +0000 (18:26 +0000)
commit3f6774d7d7a36014414a11c83e242249c5731d88
tree07f9a6d94159774f5f370283c8bb82447a76e100
parent302fbf7a2fbadfd7de8fa6024a2d8a02b8eccbdd
REGRESSION (r173484): Reducing content of scrollable region does not reset scroll
position
https://bugs.webkit.org/show_bug.cgi?id=138525
-and corresponding-
rdar://problem/18166043

Reviewed by Simon Fraser.

Source/WebCore:

The change that caused this regression was correct. That change does not allow
RenderLayer to update scroll position after a layout if a rubber-band is currently
happening. The change caused this regression because all of the member variables
in ScrollController that attempt to keep track of the current state of the scroll
gesture (m_inScrollGesture, m_momentumScrollInProgress, and
m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was
still in action for this div even though it very much is not when the bug happens.
Those variables were never properly re-set because the
PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController,
which brought the investigation back to Element.

We must still dispatch events that have zero delta so that the default event
handlers can handle them, but we should stopPropagation() so that these events are
not sent to the DOM. Websites will break if they get wheel events with no delta.
* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent):

LayoutTests:

* platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-reduced-content-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-reduced-content.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events-expected.txt: Added.
* platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-reduced-content-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-reduced-content.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp