Bug 597286, part 4: Use cancel pending where appropriate [r=mbrubeck]
--- 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);