Bug 602985 JS error: _dragger is null r=mbrubeck
authorBenjamin Stover <bstover@mozilla.com>
Fri, 08 Oct 2010 15:18:42 -0700
changeset 66812 8ed5311f368f567524536483a52dc2e472d47f11
parent 66811 71d002b5a0495dc8f3127c2258634dd4adb2cdbb
child 66813 cd01ea394b84fe7fc7669c5be45cf3af65bcd67b
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
bugs602985
Bug 602985 JS error: _dragger is null r=mbrubeck
mobile/chrome/content/input.js
--- a/mobile/chrome/content/input.js
+++ b/mobile/chrome/content/input.js
@@ -315,22 +315,26 @@ MouseModule.prototype = {
     if (!this._kinetic.isActive())
       this._dragger.dragStart(event.clientX, event.clientY, event.target, this._targetScrollInterface);
   },
 
   /** Finish a drag. */
   _doDragStop: function _doDragStop() {
     this._dragData.endDrag();
 
+    // Note: it is possible for kinetic scrolling to be active from a
+    // mousedown/mouseup event previous to this one. In this case, we
+    // want the kinetic panner to tell our drag interface to stop.
+
     let dragData = this._dragData;
-    if (!dragData.isPan()) {
-      // There was no pan, so just stop dragger.
+    if (!dragData.isPan() && !this._kinetic.isActive()) {
+      // There was no pan and no kinetic scrolling, so just stop dragger.
       this._dragger.dragStop(0, 0, this._targetScrollInterface);
       this._dragger = null;
-    } else {
+    } else if (dragData.isPan()) {
       // Start kinetic pan.
       let [sX, sY] = dragData.panPosition();
       let dX = dragData.prevPanX - sX;
       let dY = dragData.prevPanY - sY;
       this._kinetic.addData(-dX, -dY);
       this._kinetic.start();
     }
   },