Add support for gesture scroll events that do not propagate to enclosing scrollables
https://bugs.webkit.org/show_bug.cgi?id=108849

Reviewed by Antonio Gomes.

Source/WebCore:

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

Rename RenderLayer::scrollByRecursively() to RenderLayer::scrollBy() and add a parameter
of type RenderLayer::ScrollPropagation to specify whether or not the scroll should
propagate to its parent by recursing. Implement RenderLayer::scrollByRecursively() as a
call to RenderLayer::scrollBy() with argument RenderLayer::ShouldPropagateScroll so
that all existing calls to the function still produce the correct behavior.

In EventHandler::handleGestureScrollUpdate(), call RenderLayer::scrollBy() with
argument RenderLayer::ShouldPropagateScroll if |gestureEvent| is a GestureScrollUpdate
or instead with argument RenderLayer::DontPropagateScroll if |gestureEvent| is a
GestureScrollUpdateWithoutPropagation.

* dom/GestureEvent.cpp:
(WebCore::GestureEvent::create):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureScrollUpdate):
* platform/PlatformEvent.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::gestureEvent):
* platform/chromium/PopupContainer.cpp:
(WebCore::PopupContainer::handleGestureEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollByRecursively):
(WebCore):
(WebCore::RenderLayer::scrollBy):
* rendering/RenderLayer.h:

Source/WebKit/chromium:

Define the new event type GestureScrollUpdateWithoutPropagation.

* public/WebInputEvent.h:
(WebKit::WebInputEvent::isGestureEventType):
* src/PageWidgetDelegate.cpp:
(WebKit::PageWidgetDelegate::handleInputEvent):
* src/WebInputEventConversion.cpp:
(WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
* src/WebPluginContainerImpl.cpp:
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenuImpl::handleInputEvent):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleGestureEvent):

Tools:

Modify chromium's DRT EventSender to support the new event type
GestureScrollUpdateWithoutPropagation.

* DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:
(WebTestRunner):
(WebTestRunner::EventSender::EventSender):
(WebTestRunner::EventSender::gestureScrollUpdateWithoutPropagation):
(WebTestRunner::EventSender::gestureEvent):
* DumpRenderTree/chromium/TestRunner/src/EventSender.h:
(EventSender):
* DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp:
(WebTestRunner::TestPlugin::handleInputEvent):

LayoutTests:

New tests added to ensure that GestureScrollUpdateWithoutPropagation events will not
propagate to the scrollable parent of their target when the target has no area
left to be scrolled.

Modified two chromium-specific plugin tests to ensure that the plugins receive
GestureScrollUpdate events when GestureScrollUpdateWithoutPropagation events are
dispatched to them.

* fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html: Added.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html: Added.
* fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated-expected.txt: Added.
* platform/chromium/plugins/gesture-events-expected.txt:
* platform/chromium/plugins/gesture-events-scrolled-expected.txt:
* platform/chromium/plugins/gesture-events-scrolled.html:
* platform/chromium/plugins/gesture-events.html:


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