Title: [128794] trunk
Revision
128794
Author
[email protected]
Date
2012-09-17 12:39:39 -0700 (Mon, 17 Sep 2012)

Log Message

Source/WebCore: Allow gesture events to set active/hover state.
https://bugs.webkit.org/show_bug.cgi?id=96060

Patch by Rick Byers <[email protected]> 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 <[email protected]> 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 <[email protected]> on 2012-09-17
Reviewed by Antonio Gomes.

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

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt (0 => 128794)


--- trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,13 @@
+Gestures go here
+Tests that tap gesture events set and clear the active state of elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+GestureTapDown is not supported by this platform
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt (0 => 128794)


--- trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,13 @@
+
+Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+GestureTapDown is not supported by this platform
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html (0 => 128794)


--- trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<script src=""
+<style type="text/css">
+#frame {
+    position: absolute;
+    top: 300px;
+    left: 400px;
+    height: 3000px;
+}
+
+</style>
+<body>
+<iframe src='' id='frame'>
+</iframe>
+
+<p id="description"></p>
+<p>See https://bugs.webkit.org/show_bug.cgi?id=96060 for details</p>
+
+<div id="console"></div>
+
+<script>
+
+description("Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.");
+
+var isBoxActive;
+function runTests(ba)
+{
+    isBoxActive = ba;
+
+    if (!window.eventSender) {
+        debug('This test requires DRT.');
+        return;
+    }
+
+    if (!eventSender.gestureTapDown) {
+        debug('GestureTapDown is not supported by this platform');
+        return;
+    }
+    
+    // Scroll so the box is at the top
+    window.scrollTo(0, 400);
+
+    debug("Verify active isn't initially set");
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify tapdown,tap sets and clears active");
+    eventSender.gestureTapDown(450, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTap(450, 50);
+    shouldBeFalse("isBoxActive()");
+
+    isSuccessfullyParsed();
+    testRunner.notifyDone();
+}
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+}
+
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html (0 => 128794)


--- trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html>
+<script src=""
+<style type="text/css">
+#box {
+    background-color: blue;
+    width: 300px;
+    height: 100px;
+}
+
+#box:active {
+    background-color: red;
+}
+
+</style>
+<body>
+<div id="box">Gestures go here</div>
+
+<p id="description"></p>
+<p>See https://bugs.webkit.org/show_bug.cgi?id=96060 for details</p>
+
+<div id="console"></div>
+
+<script>
+var color;
+function isBoxActive()
+{
+    // These need to match the background-color used above, after round-tripping.
+    var defaultColor = "rgb(0, 0, 255)";
+    var activeColor = "rgb(255, 0, 0)";
+
+    var b = document.getElementById('box');
+    color = window.getComputedStyle(b).backgroundColor;
+    if (color == activeColor)
+      return true;
+    if (color != defaultColor)
+      testFailed('Got unexpected backgroundColor: ' + color);
+    return false;
+}
+
+description("Tests that tap gesture events set and clear the active state of elements.");
+
+function runTests()
+{
+    if (!window.eventSender) {
+        debug('This test requires DRT.');
+        return;
+    }
+
+    if (!eventSender.gestureTapDown) {
+        debug('GestureTapDown is not supported by this platform');
+        return;
+    }
+
+    debug("Verify active isn't initially set");
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify tapdown,tap sets and clears active");
+    eventSender.gestureTapDown(50, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTap(50, 50);
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify tapdown,tapcancel on the element sets and clears active");
+    eventSender.gestureTapDown(50, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTapCancel(50, 50);
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify tap elsewhere still clears active");
+    eventSender.gestureTapDown(50, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTap(400, 250);
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify tapCancel elsewhere still clears active");
+    eventSender.gestureTapDown(50, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTapCancel(400, 250);
+    shouldBeFalse("isBoxActive()");
+
+    debug("Verify that touchstart doesn't trigger active state");
+    eventSender.addTouchPoint(50, 50);
+    eventSender.touchStart();
+    shouldBeFalse("isBoxActive()");
+    eventSender.releaseTouchPoint(0);
+    eventSender.touchEnd();
+
+    debug("Verify that touchstart/touchend doesn't cancel active");
+    eventSender.gestureTapDown(50, 50);
+    shouldBeTrue("isBoxActive()");
+    eventSender.addTouchPoint(50, 50);
+    eventSender.touchStart();
+    shouldBeTrue("isBoxActive()");
+    eventSender.releaseTouchPoint(0);
+    eventSender.touchEnd();
+    shouldBeTrue("isBoxActive()");
+    eventSender.gestureTap(50, 50);
+    shouldBeFalse("isBoxActive()");
+}
+
+runTests();
+</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/events/touch/gesture/resources/gesture-tap-active-state-iframe-inner.html (0 => 128794)


--- trunk/LayoutTests/fast/events/touch/gesture/resources/gesture-tap-active-state-iframe-inner.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/resources/gesture-tap-active-state-iframe-inner.html	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<style type="text/css">
+#box {
+    position: absolute;
+    background-color: blue;
+    width: 300px;
+    height: 100px;
+    top: 100px;
+}
+
+#box:active {
+    background-color: red;
+}
+
+</style>
+<script>
+var color;
+function isBoxActive()
+{
+    // These need to match the background-color used above, after round-tripping.
+    var defaultColor = "rgb(0, 0, 255)";
+    var activeColor = "rgb(255, 0, 0)";
+
+    var b = document.getElementById('box');
+    color = getComputedStyle(b).backgroundColor;
+    if (color == activeColor)
+      return true;
+    if (color != defaultColor)
+      throw "Got unexpected backgroundColor: " + color;
+    return false;
+}
+
+</script>
+<body _onload_='parent.runTests(isBoxActive)'>
+<div id='box'>Gestures go here</div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-expected.txt (0 => 128794)


--- trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,33 @@
+Gestures go here
+Tests that tap gesture events set and clear the active state of elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+Verify active isn't initially set
+PASS isBoxActive() is false
+Verify tapdown,tap sets and clears active
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+Verify tapdown,tapcancel on the element sets and clears active
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+Verify tap elsewhere still clears active
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+Verify tapCancel elsewhere still clears active
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+Verify that touchstart doesn't trigger active state
+PASS isBoxActive() is false
+Verify that touchstart/touchend doesn't cancel active
+PASS isBoxActive() is true
+PASS isBoxActive() is true
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt (0 => 128794)


--- trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,17 @@
+
+Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+Verify active isn't initially set
+PASS isBoxActive() is false
+Verify tapdown,tap sets and clears active
+PASS isBoxActive() is true
+PASS isBoxActive() is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/chromium/fast/events/touch/touch-active-state-expected.txt (0 => 128794)


--- trunk/LayoutTests/platform/chromium/fast/events/touch/touch-active-state-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/fast/events/touch/touch-active-state-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,10 @@
+FAIL
+Test touches set the active state.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-expected.txt (0 => 128794)


--- trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,13 @@
+Gestures go here
+Tests that tap gesture events set and clear the active state of elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+GestureTapDown is not supported by this platform
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt (0 => 128794)


--- trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-android/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt	2012-09-17 19:39:39 UTC (rev 128794)
@@ -0,0 +1,13 @@
+
+Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
+
+GestureTapDown is not supported by this platform
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Source/WebCore/ChangeLog (128793 => 128794)


--- trunk/Source/WebCore/ChangeLog	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebCore/ChangeLog	2012-09-17 19:39:39 UTC (rev 128794)
@@ -1,3 +1,34 @@
+2012-09-17  Rick Byers  <[email protected]>
+
+        Allow gesture events to set active/hover state.
+        https://bugs.webkit.org/show_bug.cgi?id=96060
+
+        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:
+
 2012-09-17  Alec Flett  <[email protected]>
 
         IndexedDB: Use ScriptValue instead of SerializedScriptValue for get/openCursor

Modified: trunk/Source/WebCore/dom/GestureEvent.cpp (128793 => 128794)


--- trunk/Source/WebCore/dom/GestureEvent.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebCore/dom/GestureEvent.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -58,6 +58,7 @@
     case PlatformEvent::GesturePinchBegin:
     case PlatformEvent::GesturePinchEnd:
     case PlatformEvent::GesturePinchUpdate:
+    case PlatformEvent::GestureTapDownCancel:
     default:
         return 0;
     }

Modified: trunk/Source/WebCore/page/EventHandler.cpp (128793 => 128794)


--- trunk/Source/WebCore/page/EventHandler.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -264,6 +264,20 @@
     return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopNode);
 }
 
+#if ENABLE(GESTURE_EVENTS)
+static inline bool shouldGesturesTriggerActive()
+{
+    // If the platform we're on supports GestureTapDown and GestureTapCancel then we'll
+    // rely on them to set the active state. Unfortunately there's no generic way to
+    // know in advance what event types are supported.
+#if PLATFORM(CHROMIUM) && !OS(ANDROID)
+    return true;
+#else
+    return false;
+#endif
+}
+#endif
+
 #if !PLATFORM(MAC)
 
 inline bool EventHandler::eventLoopHandleMouseUp(const MouseEventWithHitTestResults&)
@@ -2400,9 +2414,20 @@
     if (gestureEvent.type() == PlatformEvent::GestureScrollEnd || gestureEvent.type() == PlatformEvent::GestureScrollUpdate)
         eventTarget = m_scrollGestureHandlingNode.get();
 
-    if (!eventTarget) {
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent;
+    if (gestureEvent.type() == PlatformEvent::GestureTapDown)
+        hitType |= HitTestRequest::Active;
+    else if (gestureEvent.type() == PlatformEvent::GestureTap || gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
+        hitType |= HitTestRequest::Release;
+    else
+        hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
+
+    if (!shouldGesturesTriggerActive())
+        hitType |= HitTestRequest::ReadOnly;
+
+    if (!eventTarget || !(hitType & HitTestRequest::ReadOnly)) {
         IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
-        HitTestResult result = hitTestResultAtPoint(hitTestPoint, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
+        HitTestResult result = hitTestResultAtPoint(hitTestPoint, false, false, DontHitTestScrollbars, hitType);
         eventTarget = result.targetNode();
     }
 
@@ -2440,6 +2465,7 @@
     case PlatformEvent::GesturePinchBegin:
     case PlatformEvent::GesturePinchEnd:
     case PlatformEvent::GesturePinchUpdate:
+    case PlatformEvent::GestureTapDownCancel:
         break;
     default:
         ASSERT_NOT_REACHED();
@@ -3574,6 +3600,11 @@
             break;
         }
 
+#if ENABLE(GESTURE_EVENTS)
+        if (shouldGesturesTriggerActive())
+            hitType |= HitTestRequest::ReadOnly;
+#endif
+
         // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
         unsigned touchPointTargetKey = point.id() + 1;
         RefPtr<EventTarget> touchTarget;

Modified: trunk/Source/WebCore/platform/PlatformEvent.h (128793 => 128794)


--- trunk/Source/WebCore/platform/PlatformEvent.h	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebCore/platform/PlatformEvent.h	2012-09-17 19:39:39 UTC (rev 128794)
@@ -54,6 +54,7 @@
         GestureScrollUpdate,
         GestureTap,
         GestureTapDown,
+        GestureTapDownCancel,
         GestureDoubleTap,
         GestureTwoFingerTap,
         GestureLongPress,

Modified: trunk/Source/WebKit/chromium/ChangeLog (128793 => 128794)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-09-17 19:39:39 UTC (rev 128794)
@@ -1,3 +1,23 @@
+2012-09-17  Rick Byers  <[email protected]>
+
+        Send GestureTapDownCancel to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=96060
+
+        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):
+
 2012-09-17  Alec Flett  <[email protected]>
 
         IndexedDB: Use ScriptValue instead of SerializedScriptValue for get/openCursor

Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (128793 => 128794)


--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -162,6 +162,9 @@
         m_type = PlatformEvent::GestureTapDown;
         m_area = IntSize(e.data.tapDown.width, e.data.tapDown.height);
         break;
+    case WebInputEvent::GestureTapCancel:
+        m_type = PlatformEvent::GestureTapDownCancel;
+        break;
     case WebInputEvent::GestureDoubleTap:
         m_type = PlatformEvent::GestureDoubleTap;
         break;

Modified: trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp (128793 => 128794)


--- trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -277,6 +277,7 @@
     case WebInputEvent::GestureFlingCancel:
     case WebInputEvent::GestureTap:
     case WebInputEvent::GestureTapDown:
+    case WebInputEvent::GestureTapCancel:
     case WebInputEvent::GestureDoubleTap:
     case WebInputEvent::GestureTwoFingerTap:
     case WebInputEvent::GestureLongPress:
@@ -288,7 +289,6 @@
     case WebInputEvent::Undefined:
     case WebInputEvent::MouseEnter:
     case WebInputEvent::ContextMenu:
-    case WebInputEvent::GestureTapCancel:
         return false;
     }
     return false;

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (128793 => 128794)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -765,15 +765,12 @@
         m_client->cancelScheduledContentIntents();
     case WebInputEvent::GestureScrollEnd:
     case WebInputEvent::GestureScrollUpdate:
+    case WebInputEvent::GestureTapCancel:
     case WebInputEvent::GesturePinchEnd:
     case WebInputEvent::GesturePinchUpdate: {
         PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
         return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
     }
-    case WebInputEvent::GestureTapCancel:
-        // FIXME: Update WebCore to handle this event after chromium has been updated to send it
-        // http://wkb.ug/96060
-        return false;
     default:
         ASSERT_NOT_REACHED();
     }

Modified: trunk/Tools/ChangeLog (128793 => 128794)


--- trunk/Tools/ChangeLog	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Tools/ChangeLog	2012-09-17 19:39:39 UTC (rev 128794)
@@ -1,3 +1,16 @@
+2012-09-17  Rick Byers  <[email protected]>
+
+        Add handling of new GestureTapCancel in DRT
+
+        https://bugs.webkit.org/show_bug.cgi?id=96183
+
+        Reviewed by Antonio Gomes.
+
+        * DumpRenderTree/chromium/TestWebPlugin.cpp:
+        (TestWebPlugin::handleInputEvent):
+        * DumpRenderTree/chromium/EventSender.cpp:
+        (EventSender::gestureTapCancel):
+
 2012-09-17  Philip Rogers  <[email protected]>
 
         Teach style checker about preprocessor directive indentation rules

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp (128793 => 128794)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp	2012-09-17 19:39:39 UTC (rev 128794)
@@ -287,6 +287,7 @@
     bindMethod("gestureScrollUpdate", &EventSender::gestureScrollUpdate);
     bindMethod("gestureTap", &EventSender::gestureTap);
     bindMethod("gestureTapDown", &EventSender::gestureTapDown);
+    bindMethod("gestureTapCancel", &EventSender::gestureTapCancel);
     bindMethod("gestureLongPress", &EventSender::gestureLongPress);
     bindMethod("gestureTwoFingerTap", &EventSender::gestureTwoFingerTap);
     bindMethod("zoomPageIn", &EventSender::zoomPageIn);
@@ -1119,6 +1120,12 @@
     gestureEvent(WebInputEvent::GestureTapDown, arguments);
 }
 
+void EventSender::gestureTapCancel(const CppArgumentList& arguments, CppVariant* result)
+{
+    result->setNull();
+    gestureEvent(WebInputEvent::GestureTapCancel, arguments);
+}
+
 void EventSender::gestureLongPress(const CppArgumentList& arguments, CppVariant* result)
 {
     result->setNull();
@@ -1182,6 +1189,10 @@
         event.x = point.x;
         event.y = point.y;
         break;
+    case WebInputEvent::GestureTapCancel:
+        event.x = point.x;
+        event.y = point.y;
+        break;
     case WebInputEvent::GestureLongPress:
         event.x = point.x;
         event.y = point.y;

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.h (128793 => 128794)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.h	2012-09-17 19:33:49 UTC (rev 128793)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.h	2012-09-17 19:39:39 UTC (rev 128794)
@@ -106,6 +106,7 @@
     void gestureScrollUpdate(const CppArgumentList&, CppVariant*);
     void gestureTap(const CppArgumentList&, CppVariant*);
     void gestureTapDown(const CppArgumentList&, CppVariant*);
+    void gestureTapCancel(const CppArgumentList&, CppVariant*);
     void gestureLongPress(const CppArgumentList&, CppVariant*);
     void gestureTwoFingerTap(const CppArgumentList&, CppVariant*);
     void gestureEvent(WebKit::WebInputEvent::Type, const CppArgumentList&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to