Source/WebCore: Allow gesture events to set active/hover state.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2012 19:39:39 +0000 (19:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2012 19:39:39 +0000 (19:39 +0000)
commit90d46e97f08ab24dd2bbb056abcc2d3617f7ef2f
tree8434f8bf3435877028176a52cb34b232bebf1e33
parentfd071462f806d5e03b6488d1a1e618784184c689
Source/WebCore: Allow gesture events to set active/hover state.
https://bugs.webkit.org/show_bug.cgi?id=96060

Patch by Rick Byers <rbyers@chromium.org> on 2012-09-17
Reviewed by Antonio Gomes.

Adds GestureTapDownCancel as a new PlatformGestureEvent type.  On ports
that support gesture events, use GestureTapDown to trigger active/hover
states, and GestureTap/GestureTapDownCancel to clear them.  This is
superior to using touch events for a number of reasons:
  1) some ports (chromium) avoid sending touch events unless absolutely
  necessary, since they hurt scroll performance by blocking threaded
  scrolling.
  2) with touch, and element really shouldn't be 'active' when the user
  happens to be touching it while scrolling.  In that case they aren't
  'manipulating the element', they're manipulating the page or div that
  is scrolling.
  3) similarly, there may be other gestures that involve touching the
  element which aren't really about manipulating that element (eg.
  pinch to zoom).

Test: fast/events/touch/gesture/gesture-tap-active-state.html
Test: fast/events/touch/gesture/gesture-tap-active-state-iframe.html
* dom/GestureEvent.cpp:
(WebCore::GestureEvent::create):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleTouchEvent):
* platform/PlatformEvent.h:

Source/WebKit/chromium: Send GestureTapDownCancel to WebCore
https://bugs.webkit.org/show_bug.cgi?id=96060

Patch by Rick Byers <rbyers@chromium.org> on 2012-09-17
Reviewed by Antonio Gomes.

Plumb WebInputEvent::GetsureTapCancel to
PlatformInputEvent::GestureTapDownCancel.  After all the chromium code
was landed, it was suggested that 'TapDownCancel' was a better name
than 'TapCancel' since you can't cancel a Tap.  I'm not changing the
WebInputEvent definition here because that would be a breaking change
to chromium, but I can do that as a series of follow-up CLs.
* src/WebInputEventConversion.cpp:
(WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenuImpl::handleInputEvent):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleGestureEvent):

Tools: Add handling of new GestureTapCancel in DRT

https://bugs.webkit.org/show_bug.cgi?id=96183

Patch by Rick Byers <rbyers@chromium.org> on 2012-09-17
Reviewed by Antonio Gomes.

* DumpRenderTree/chromium/TestWebPlugin.cpp:
(TestWebPlugin::handleInputEvent):
* DumpRenderTree/chromium/EventSender.cpp:
(EventSender::gestureTapCancel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html [new file with mode: 0644]
LayoutTests/fast/events/touch/gesture/resources/gesture-tap-active-state-iframe-inner.html [new file with mode: 0644]
LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/touch-active-state-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/GestureEvent.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/platform/PlatformEvent.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebInputEventConversion.cpp
Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
Tools/DumpRenderTree/chromium/TestRunner/EventSender.h