Bug 675750 - Back out 10cb6aeef385 (bug 672411) on suspicion of causing talos tp4m failures
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 01 Aug 2011 15:40:04 -0700
changeset 73643 ac9bc4e2b2dd9dd41434876ed8c6fcc4c2da19c8
parent 73642 ae35b244a09a141ccd4fcfe3b7832cccc9b5425c
child 73644 617081e0fdf5c03310a77b6a7963d61083dcabfc
push id20900
push usermak77@bonardo.net
push dateTue, 02 Aug 2011 09:54:14 +0000
treeherdermozilla-central@10927265c555 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs675750, 672411
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 675750 - Back out 10cb6aeef385 (bug 672411) on suspicion of causing talos tp4m failures
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2726,18 +2726,18 @@ Tab.prototype = {
       } else if (!validW && !validH) {
         viewportW = this.useFallbackWidth ? kFallbackBrowserWidth : kDefaultBrowserWidth;
         viewportH = kDefaultBrowserWidth * (screenH / screenW);
       }
     }
 
     // Make sure the viewport height is not shorter than the window when
     // the page is zoomed out to show its full width.
-    let minScale = this.clampZoomLevel(this.getPageZoomLevel());
-    viewportH = Math.max(viewportH, screenH / minScale);
+    if (viewportH * this.clampZoomLevel(this.getPageZoomLevel()) < screenH)
+      viewportH = Math.max(viewportH, screenH * (browser.contentDocumentWidth / screenW));
 
     if (browser.contentWindowWidth != viewportW || browser.contentWindowHeight != viewportH)
       browser.setWindowSize(viewportW, viewportH);
   },
 
   restoreViewportPosition: function restoreViewportPosition(aOldWidth, aNewWidth) {
     let browser = this._browser;
 
@@ -2860,23 +2860,20 @@ Tab.prototype = {
       this._browser = null;
       this._loading = false;
 
       Elements.browsers.removeChild(notification);
     }
   },
 
   clampZoomLevel: function clampZoomLevel(aScale) {
-    let md = this.metadata;
-    if (!this.allowZoom)
-      return (md && md.defaultZoom) ? md.defaultZoom : this.getPageZoomLevel();
-
     let browser = this._browser;
     let bounded = Util.clamp(aScale, ZoomManager.MIN, ZoomManager.MAX);
 
+    let md = this.metadata;
     if (md && md.minZoom)
       bounded = Math.max(bounded, md.minZoom);
     if (md && md.maxZoom)
       bounded = Math.min(bounded, md.maxZoom);
 
     bounded = Math.max(bounded, this.getPageZoomLevel());
 
     let rounded = Math.round(bounded * kBrowserViewZoomLevelPrecision) / kBrowserViewZoomLevelPrecision;