bug 534737. move scrollContentToTop back to onLocationChange. r=mfinkle
authorStuart Parmenter <stuart@mozilla.com>
Tue, 15 Dec 2009 12:38:44 -0800
changeset 65920 c3cb34a985e538f841680721c2c4c64ad2ceb27a
parent 65919 0529376c8f1a68fbde2bca853d12d3184e9ff216
child 65921 29ad2820d151e558c525f15ed4cec3e42102459e
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
bugs534737
bug 534737. move scrollContentToTop back to onLocationChange. r=mfinkle
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2564,16 +2564,20 @@ ProgressController.prototype = {
     this._hostChanged = true;
     
     if (location != this.browser.lastSpec) {
       this.browser.lastSpec = this.browser.currentURI.spec;
       Browser.removeTransientNotificationsForTab(this._tab);
 
       if (this._tab == Browser.selectedTab) {
         BrowserUI.updateURI();
+
+       // We're about to have new page content, to scroll the content area
+       // to the top so the new paints will draw correctly.
+       Browser.scrollContentToTop();
       }
     }
   },
 
   /**
    * This method is called to indicate a status changes for the currently
    * loading page.  The message is already formatted for display.
    */
@@ -2759,33 +2763,27 @@ Tab.prototype = {
    * Throttles redraws to once every 2 seconds while loading the page, zooming to fit page if
    * user hasn't started zooming.
    */
   _resizeAndPaint: function _resizeAndPaint() {
     let bv = Browser._browserView;
 
     bv.commitBatchOperation();
 
-    if (this._loadingPaintCount == 0)
-      Browser.scrollContentToTop();
-
     // kick ourselves off 2s later while we're still loading
     bv.beginBatchOperation();
     this._loadingTimeout = setTimeout(this._resizeAndPaint, 2000);
-
-    this._loadingPaintCount++;
   },
 
   _startResizeAndPaint: function _startResizeAndPaint() {
     if (this._loadingTimeout)
       throw "Already have a loading timeout";
 
     Browser._browserView.beginBatchOperation();
     this._loadingTimeout = setTimeout(this._resizeAndPaint, 2000);
-    this._loadingPaintCount = 0;
   },
 
   _stopResizeAndPaint: function _stopResizeAndPaint() {
     if (!this._loadingTimeout)
       throw "No loading timeout!";
 
     clearTimeout(this._loadingTimeout);
     delete this._loadingTimeout;