Bug 539493 - Always pause rendering during drag [r=mfinkle]
authorBenjamin Stover <bstover@mozilla.com>
Wed, 13 Jan 2010 12:30:08 -0800
changeset 65965 a88a7f34aaa018940886b572350b4e0ab8350048
parent 65964 e0e1e6ec5b0e8e1f2410e7e8712ab0a34e52a854
child 65966 7790c4490c29a4d2686a59a6585c71a16cd0c131
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)
reviewersmfinkle
bugs539493
Bug 539493 - Always pause rendering during drag [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1356,16 +1356,25 @@ Browser.MainDragger = function MainDragg
   this.draggedFrame = null;
   this.contentScrollbox = null;
 };
 
 Browser.MainDragger.prototype = {
   isDraggable: function isDraggable(target, scroller) { return true; },
 
   dragStart: function dragStart(clientX, clientY, target, scroller) {
+    // Make sure pausing occurs before any early returns.
+    this.bv.pauseRendering();
+
+    // XXX shouldn't know about observer
+    // adding pause in pauseRendering isn't so great, because tiles will hardly ever prefetch while
+    // loading state is going (and already, the idle timer is bigger during loading so it doesn't fit
+    // into the aggressive flag).
+    this.bv._idleServiceObserver.pause();
+
     let [x, y] = Browser.transformClientToBrowser(clientX, clientY);
     let element = Browser.elementFromPoint(x, y);
 
     this.draggedFrame = null;
     this.contentScrollbox = null;
 
     // Check if we are in a scrollable HTML element
     let htmlElement = element;
@@ -1409,24 +1418,16 @@ Browser.MainDragger.prototype = {
           this.contentScrollbox = wrapper.scrollBoxObject || wrapper.boxObject.QueryInterface(Ci.nsIScrollBoxObject);
           return;
         }
       }
     }
 
     if (element)
       this.draggedFrame = element.ownerDocument.defaultView;
-
-    this.bv.pauseRendering();
-
-    // XXX shouldn't know about observer
-    // adding pause in pauseRendering isn't so great, because tiles will hardly ever prefetch while
-    // loading state is going (and already, the idle timer is bigger during loading so it doesn't fit
-    // into the aggressive flag).
-    this.bv._idleServiceObserver.pause();
   },
 
   dragStop: function dragStop(dx, dy, scroller) {
     this.draggedFrame = null;
     this.dragMove(Browser.snapSidebars(), 0, scroller);
 
     Browser.tryUnfloatToolbar();