Add support for gesture scroll events that do not propagate to enclosing scrollables
authortdanderson@chromium.org <tdanderson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 01:01:32 +0000 (01:01 +0000)
committertdanderson@chromium.org <tdanderson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 01:01:32 +0000 (01:01 +0000)
commitbb453a807d1d472c0329e3f805f8ee31b4512d8a
treec86d3679fde3da4f4c0b35abd444e7323928edd5
parentbb83464222aac486ff3d432c64ef9b61d16ed6a3
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: https://svn.webkit.org/repository/webkit/trunk@142057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/plugins/gesture-events-expected.txt
LayoutTests/platform/chromium/plugins/gesture-events-scrolled-expected.txt
LayoutTests/platform/chromium/plugins/gesture-events-scrolled.html
LayoutTests/platform/chromium/plugins/gesture-events.html
Source/WebCore/ChangeLog
Source/WebCore/dom/GestureEvent.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/platform/PlatformEvent.h
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/chromium/PopupContainer.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebInputEvent.h
Source/WebKit/chromium/src/PageWidgetDelegate.cpp
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp
Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.h
Tools/DumpRenderTree/chromium/TestRunner/src/TestPlugin.cpp