Bug 535551 - Missing dragData declaration in onMouseDown in InputHandler.js [r=mark.finkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 17 Dec 2009 21:46:51 -0500
changeset 1248 c873789bc66846a63ea3146691fb40e5bb7d78dc
parent 1247 27df02e7bdfc1eb1fdac2f07beccbfc88968c145
child 1249 43c4e1d5909f416cf487f757b54a4de6aaf5cffd
push id1112
push usermfinkle@mozilla.com
push dateFri, 18 Dec 2009 02:47:35 +0000
reviewersmark.finkle
bugs535551
Bug 535551 - Missing dragData declaration in onMouseDown in InputHandler.js [r=mark.finkle]
chrome/content/InputHandler.js
--- a/chrome/content/InputHandler.js
+++ b/chrome/content/InputHandler.js
@@ -467,22 +467,24 @@ MouseModule.prototype = {
    * a clicker, and initiating a drag if we have said scrollable element.  The
    * mousedown event is entirely swallowed but is saved for later redispatching,
    * once we know right and proper what the input is trying to do to us.
    *
    * We grab() in here.
    */
   _onMouseDown: function _onMouseDown(evInfo) {
     this._owner.allowClicks();
-    if (this._dragData.dragging) {
+
+    let dragData = this._dragData;
+    if (dragData.dragging) {
       // Somehow a mouse up was missed.
       let [sX, sY] = dragData.panPosition();
       this._doDragStop(sX, sY, !dragData.isPan());
     }
-    this._dragData.reset();
+    dragData.reset();
 
     // walk up the DOM tree in search of nearest scrollable ancestor.  nulls are
     // returned if none found.
     let [targetScrollbox, targetScrollInterface]
       = this.getScrollboxFromElement(evInfo.event.target);
 
     // stop kinetic panning if targetScrollbox has changed
     let oldInterface = this._targetScrollInterface;
@@ -508,17 +510,17 @@ MouseModule.prototype = {
     if (this._targetIsContent(evInfo.event)) {
       this._recordEvent(evInfo);
     }
     else if (targetScrollInterface) {
       // do not allow axis locking if panning is only possible in one direction
       let cX = {}, cY = {};
       targetScrollInterface.getScrolledSize(cX, cY);
       let rect = targetScrollbox.getBoundingClientRect();
-      this._dragData.locked = ((cX.value > rect.width) != (cY.value > rect.height));
+      dragData.locked = ((cX.value > rect.width) != (cY.value > rect.height));
     }
   },
 
   /**
    * Handle a mouseup by swallowing the event (just as we did the mousedown) as
    * well as the possible DOM click event that follows, making one last drag
    * (which, do note, might just be the beginning of a kinetic drag that will
    * linger long after we are gone), and recording the mousedown for later