Bug 597286, part 4: Use cancel pending where appropriate [r=mbrubeck]
authorBenjamin Stover <bstover@mozilla.com>
Wed, 22 Sep 2010 15:05:18 -0700
changeset 66683 334e8098f6dea6e925ac9475d57bb14016333aff
parent 66682 2c9b0843d8be2b829380d69dfffe3b8de080bbdb
child 66684 0880959c0152925185e2001445612f6223cc0041
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
bugs597286
Bug 597286, part 4: Use cancel pending where appropriate [r=mbrubeck]
mobile/chrome/content/InputHandler.js
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -358,42 +358,32 @@ MouseModule.prototype = {
         break;
       case "mousemove":
         this._onMouseMove(aEvent);
         break;
       case "mouseup":
         this._onMouseUp(aEvent);
         break;
       case "contextmenu":
-        if (ContextHelper.popupState && this._dragData.dragging)
-          this._doDragStop();
-        break;
-      case "MozMagnifyGestureStart":
-      case "MozMagnifyGesture":
-        // disallow kinetic panning after gesture
-        if (this._dragData.dragging)
-          this._doDragStop();
+        if (ContextHelper.popupState)
+          this.cancelPending();
         break;
       case "MozBeforePaint":
         this._waitingForPaint = false;
         removeEventListener("MozBeforePaint", this, false);
         break;
     }
   },
 
   receiveMessage: function receiveMessage(aMessage) {
     // TODO: Make "contextmenu" a first class part of InputHandler
     // Bug 554639
     if (aMessage.name != "Browser:ContextMenu" || !ContextHelper.popupState)
       return;
 
-    if (this._clicker)
-      this._clicker.panBegin();
-    if (this._dragger)
-      this._dragger.dragStop(0, 0, this._targetScrollInterface);
     this.cancelPending();
   },
 
   /**
    * This gets invoked by the input handler if another module grabs.  We should
    * reset our state or something here.  This is probably doing the wrong thing
    * in its current form.
    */
@@ -439,16 +429,17 @@ MouseModule.prototype = {
     if (this._kinetic.isActive() && this._dragger != dragger)
       this._kinetic.end();
 
     let targetClicker = this.getClickerFromElement(aEvent.target);
 
     this._targetScrollInterface = targetScrollInterface;
     this._dragger = dragger;
     this._clicker = (targetClicker) ? targetClicker.customClicker : null;
+    this._target = aEvent.target;
 
     if (this._clicker)
       this._clicker.mouseDown(aEvent.clientX, aEvent.clientY);
 
     if (this._dragger) {
       let draggable = this._dragger.isDraggable(targetScrollbox, targetScrollInterface);
       if (draggable.x || draggable.y)
         this._doDragStart(aEvent);