Fix gesture scrolling when the target-element of scroll-begin is removed
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 16:06:11 +0000 (16:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Nov 2012 16:06:11 +0000 (16:06 +0000)
commit03f505f6d19366529a3e1081ac519478c7fc6bed
tree75a778c5dfbdb45f1be5e381edf1f7eca86c6e2b
parent1e232279f6bf0480e81d9bb2f2f7f6fcd49e18fa
Fix gesture scrolling when the target-element of scroll-begin is removed
https://bugs.webkit.org/show_bug.cgi?id=103355

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-11-28
Reviewed by Antonio Gomes.

Source/WebCore:

When a touch-scroll starts, the node under the touch-point gets latched, and
subsequent scroll-update events are dispatched to that node. But if the node is
removed while the gesture event is in progress (e.g. in a dynamically updated
list), then the scrolling stops, although there are enough elements to still
enable scrolling. So instead of latching on to the node immediately under the
touch point, latch on to the scrollable node under the touch point.

Test: fast/events/touch/gesture/touch-gesture-scroll-remove-node.html

* page/EventHandler.cpp:
(WebCore::getClosestScrollableNodeInDocumentIfPossible):
(WebCore):
(WebCore::EventHandler::handleWheelEvent):

LayoutTests:

Added a test that starts a touch-scroll, removes the initial element under the
touch-point, and scrolls some more, to test that the scrolling happens correctly
after the element is removed.

* fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-remove-node.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp