Scroll gestures should not create wheel events
https://bugs.webkit.org/show_bug.cgi?id=103952

Reviewed by James Robinson.

Source/WebCore:

Tests: fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html
       fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html

In EventHandler::handleGestureEvent(), scroll gestures should not be handled by synthesizing
and dispatching wheel events; we should instead scroll the relevant layer directly.

Note that this patch should be landed together with the patch for
https://bugs.webkit.org/show_bug.cgi?id=106589.

* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::passGestureEventToWidget):
(WebCore::EventHandler::passGestureEventToWidgetIfPossible):
(WebCore):
(WebCore::closestScrollableNodeInDocumentIfPossibleOrSelfIfNotScrollable):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::handleGestureScrollUpdate):
(WebCore::EventHandler::isScrollbarHandlingGestures):
* page/EventHandler.h:
(EventHandler):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollByRecursively):
* rendering/RenderLayer.h:

LayoutTests:

Added five new layout tests to check that scroll gestures will correctly scroll
nested divs and iframes. Also modified existing layout tests to no longer
expect mousewheel events.

* fast/events/touch/gesture/resources/scroll-inside-editable-iframe.html: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-div-scaled.html:
* fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-div.html:
* fast/events/touch/gesture/touch-gesture-scroll-iframe-editable-expected.txt: Copied from LayoutTests/platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-expected.txt.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe.html.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-iframe.html:
* fast/events/touch/gesture/touch-gesture-scroll-page-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-page.html:
* fast/events/touch/gesture/touch-gesture-scroll-shy-target.html:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-scaled-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-shy-target-expected.txt:
* platform/chromium/plugins/gesture-events-expected.txt:
* platform/chromium/plugins/gesture-events-scrolled-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140177 268f45cc-cd09-0410-ab3c-d52691b4dbfc