Bug 486136: Reduce painting during startup r=mfinkle
authorTaras Glek <tglek@mozilla.com>
Tue, 31 Mar 2009 11:38:34 -0700
changeset 65150 1a122cf4b1dce2a4f3e9fe45ac26f23d697dde65
parent 65149 3461f4972ed18f9ea3b53800d4936f25965a0146
child 65151 f6a0c11e01d4ab813c4c1f109e55c287ee4796e6
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs486136
Bug 486136: Reduce painting during startup r=mfinkle
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -118,23 +118,16 @@ var Browser = {
       BrowserUI.sizeControls();
 
       // resize our container...
       let containerStyle = browserContainer.style;
       containerStyle.width = containerStyle.maxWidth = w + "px";
       containerStyle.height = containerStyle.maxHeight = h + "px";
 
       ws.updateSize(w, h);
-
-      if (Browser._isStartup) {
-        // now we can set the viewport to a real size and draw the page
-        ws.endUpdateBatch();
-        Browser._selectedTab.updateThumbnail();
-        Browser._isStartup = false;
-      }
     }
     window.addEventListener("resize", resizeHandler, false);
 
     function viewportHandler(bounds, boundsSizeChanged) {
       self._canvasBrowser.viewportHandler(bounds, boundsSizeChanged);
     }
     ws.setViewportHandler(viewportHandler);
 
@@ -1120,16 +1113,22 @@ ProgressController.prototype = {
 
   _networkStop: function() {
     this._tab.setLoading(false);
 
     if (Browser.selectedBrowser == this.browser) {
       Browser.canvasBrowser.endLoading();
       BrowserUI.update(TOOLBARSTATE_LOADED);
       this.browser.docShell.isOffScreenBrowser = true;
+      if (Browser._isStartup) {
+        // now we can set the viewport to a real size and draw the page
+        ws.endUpdateBatch();
+        Browser._selectedTab.updateThumbnail();
+        Browser._isStartup = false;
+      }
     }
     if (!this._isStartup)
       this._tab.updateThumbnail();
   },
 
   _documentStop: function() {
     // translate any phone numbers
     Browser.translatePhoneNumbers();