Bug 634009 - Don't click on gesture events [r=mbrubeck, a=blocking]
authorWes Johnston <wjohnston@mozilla.com>
Fri, 18 Feb 2011 10:11:47 -0800
changeset 67405 46ef7819b3e77d930661360fe4a25bd5c67c7fda
parent 67404 7bfadb5c41dab9cca99382141678222cee46e7e4
child 67406 b76d94f1bf9ad438e99f26f7f6f1ca2cce07c252
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, blocking
bugs634009
Bug 634009 - Don't click on gesture events [r=mbrubeck, a=blocking]
mobile/chrome/content/input.js
--- a/mobile/chrome/content/input.js
+++ b/mobile/chrome/content/input.js
@@ -1036,16 +1036,26 @@ GestureModule.prototype = {
    *
    * @param nsIDOMEvent information structure
    */
   handleEvent: function handleEvent(aEvent) {
     try {
       let consume = false;
       switch (aEvent.type) {
         case "MozSwipeGesture":
+
+          // Cancel other touch sequence events, and be courteous by allowing them
+          // to say no.
+          let event = document.createEvent("Events");
+          event.initEvent("CancelTouchSequence", true, true);
+          let success = aEvent.target.dispatchEvent(event);
+      
+          if (!success)
+            return;
+
           let gesture = Ci.nsIDOMSimpleGestureEvent;
           switch (aEvent.direction) {
             case gesture.DIRECTION_UP:
               Browser.scrollContentToBottom();
               break;
             case gesture.DIRECTION_DOWN:
               Browser.scrollContentToTop();
               break;