Title: [124359] trunk
Revision
124359
Author
[email protected]
Date
2012-08-01 13:10:18 -0700 (Wed, 01 Aug 2012)

Log Message

Source/WebCore: Don't request a clickCount of 1 on mouseMove event generated by tap gestures
https://bugs.webkit.org/show_bug.cgi?id=92779

Patch by Rick Byers <[email protected]> on 2012-08-01
Reviewed by Adam Barth.

mousemove events don't have a click count, so we shouldn't be passing 1
here.  Note this makes no real difference in practice since the value is
ignored - fixed strictly for pedantics.

Test: fast/events/touch/gesture/gesture-click

* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureTap):

LayoutTests: Make Gesture click test validate click count in UIEvent.detail
https://bugs.webkit.org/show_bug.cgi?id=92779

Patch by Rick Byers <[email protected]> on 2012-08-01
Reviewed by Adam Barth.

Also validates that no dblclick event is fired for this single click.
* fast/events/touch/gesture/gesture-click.html:
* platform/chromium/fast/events/touch/gesture/gesture-click-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (124358 => 124359)


--- trunk/LayoutTests/ChangeLog	2012-08-01 19:51:04 UTC (rev 124358)
+++ trunk/LayoutTests/ChangeLog	2012-08-01 20:10:18 UTC (rev 124359)
@@ -1,3 +1,14 @@
+2012-08-01  Rick Byers  <[email protected]>
+
+        Make Gesture click test validate click count in UIEvent.detail
+        https://bugs.webkit.org/show_bug.cgi?id=92779
+
+        Reviewed by Adam Barth.
+
+        Also validates that no dblclick event is fired for this single click.
+        * fast/events/touch/gesture/gesture-click.html:
+        * platform/chromium/fast/events/touch/gesture/gesture-click-expected.txt:
+
 2012-08-01  Kihong Kwon  <[email protected]>
 
         Dropping webkit prefix from Vibration API

Modified: trunk/LayoutTests/fast/events/touch/gesture/gesture-click.html (124358 => 124359)


--- trunk/LayoutTests/fast/events/touch/gesture/gesture-click.html	2012-08-01 19:51:04 UTC (rev 124358)
+++ trunk/LayoutTests/fast/events/touch/gesture/gesture-click.html	2012-08-01 20:10:18 UTC (rev 124359)
@@ -10,16 +10,21 @@
 <div id="console"></div>
 
 <script>
-var expectedMouseEvents = 4;
 var mouseEventsReceived = 0;
-var eventTypes = [ 'mousemove', 'mousedown', 'mouseup', 'click' ];
+var expectedEvents = [
+  { type: 'mousemove', detail: 0 },
+  { type: 'mousedown', detail: 1 },
+  { type: 'mouseup', detail: 1 },
+  { type: 'click', detail: 1 },
+  ];
 
 function gestureEventCallback(event)
 {
     if (window.eventSender) {
-        shouldBeEqualToString('event.type', eventTypes[mouseEventsReceived]);
+        shouldBeEqualToString('event.type', expectedEvents[mouseEventsReceived].type);
         shouldBe('event.clientX', '10');
         shouldBe('event.clientY', '12');
+        shouldEvaluateTo('event.detail', expectedEvents[mouseEventsReceived].detail);
         mouseEventsReceived++;
     } else {
         debug(event.type);
@@ -36,7 +41,7 @@
 
 function endTest()
 {
-    if (mouseEventsReceived < expectedMouseEvents) {
+    if (mouseEventsReceived < expectedEvents.length) {
         debug('Gesture manager not implemented on this platform.');
     }
     // Bail.
@@ -48,6 +53,7 @@
     var div = document.getElementById('gesture');
     div.addEventListener("mousedown", gestureEventCallback, false);
     div.addEventListener("click", gestureEventCallback, false);
+    div.addEventListener("dblclick", gestureEventCallback, false);
     div.addEventListener("mouseup", gestureEventCallback, false);
     div.addEventListener("mousemove", gestureEventCallback, false);
     document.addEventListener("keydown", quitKeyToEndTest, false);

Modified: trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-click-expected.txt (124358 => 124359)


--- trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-click-expected.txt	2012-08-01 19:51:04 UTC (rev 124358)
+++ trunk/LayoutTests/platform/chromium/fast/events/touch/gesture/gesture-click-expected.txt	2012-08-01 20:10:18 UTC (rev 124359)
@@ -6,15 +6,19 @@
 PASS event.type is "mousemove"
 PASS event.clientX is 10
 PASS event.clientY is 12
+PASS event.detail is 0
 PASS event.type is "mousedown"
 PASS event.clientX is 10
 PASS event.clientY is 12
+PASS event.detail is 1
 PASS event.type is "mouseup"
 PASS event.clientX is 10
 PASS event.clientY is 12
+PASS event.detail is 1
 PASS event.type is "click"
 PASS event.clientX is 10
 PASS event.clientY is 12
+PASS event.detail is 1
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (124358 => 124359)


--- trunk/Source/WebCore/ChangeLog	2012-08-01 19:51:04 UTC (rev 124358)
+++ trunk/Source/WebCore/ChangeLog	2012-08-01 20:10:18 UTC (rev 124359)
@@ -1,3 +1,19 @@
+2012-08-01  Rick Byers  <[email protected]>
+
+        Don't request a clickCount of 1 on mouseMove event generated by tap gestures
+        https://bugs.webkit.org/show_bug.cgi?id=92779
+
+        Reviewed by Adam Barth.
+
+        mousemove events don't have a click count, so we shouldn't be passing 1
+        here.  Note this makes no real difference in practice since the value is
+        ignored - fixed strictly for pedantics.
+        
+        Test: fast/events/touch/gesture/gesture-click
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleGestureTap):
+
 2012-08-01  Kihong Kwon  <[email protected]>
 
         Dropping webkit prefix from Vibration API

Modified: trunk/Source/WebCore/page/EventHandler.cpp (124358 => 124359)


--- trunk/Source/WebCore/page/EventHandler.cpp	2012-08-01 19:51:04 UTC (rev 124358)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2012-08-01 20:10:18 UTC (rev 124359)
@@ -2480,7 +2480,7 @@
 #endif
 
     bool defaultPrevented = false;
-    PlatformMouseEvent fakeMouseMove(adjustedPoint, gestureEvent.globalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
+    PlatformMouseEvent fakeMouseMove(adjustedPoint, gestureEvent.globalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
     PlatformMouseEvent fakeMouseDown(adjustedPoint, gestureEvent.globalPosition(), LeftButton, PlatformEvent::MousePressed, /* clickCount */ 1, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
     PlatformMouseEvent fakeMouseUp(adjustedPoint, gestureEvent.globalPosition(), LeftButton, PlatformEvent::MouseReleased, /* clickCount */ 1, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
     mouseMoved(fakeMouseMove);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to