Wheel events stop propagating when target element is removed from DOM
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 18:03:00 +0000 (18:03 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Aug 2015 18:03:00 +0000 (18:03 +0000)
commit77a635d107cddc162c2d7d1e2b85512b0a188a5b
tree92e903d856b422f59e3ec1a1ac2e4b1d3dbb93a0
parent89ea29bca514d1ab2ba36f5d2403f1e2789359f1
Wheel events stop propagating when target element is removed from DOM
https://bugs.webkit.org/show_bug.cgi?id=148384
<rdar://problem/19732211>

Reviewed by David Hyatt.

Source/WebCore:

Tested by tiled-drawing/scrolling/latched-to-deleted-node.html

We need to reset our latching state if the targeted node is removed from the DOM.
Add a check in 'platformPrepareForWheelEvents' that checks if the expected latching
target node was already removed from the DOM. If it was, we should not send events
to it, and should reset latching state so we can attach to the next relevant node.

* dom/Element.cpp:
(WebCore::Element::removedFrom): Remove any latched wheel event state objects that
match the current element.
* page/MainFrame.cpp:
(WebCore::MainFrame::removeLatchingStateForTarget): Remove any latched wheel event
state structures that match the passed wheel event target.
* page/MainFrame.h:

LayoutTests:

* tiled-drawing/scrolling/latched-to-deleted-node-expected.txt: Added.
* tiled-drawing/scrolling/latched-to-deleted-node.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/tiled-drawing/scrolling/latched-to-deleted-node-expected.txt [new file with mode: 0644]
LayoutTests/tiled-drawing/scrolling/latched-to-deleted-node.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/page/MainFrame.cpp
Source/WebCore/page/MainFrame.h