Bug 614353: Make sure the viewport spans the full window height when zoomed out [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 18 Jan 2011 11:27:02 -0800
changeset 67271 a133273c6f9e6aabe90e9c78095eecaca56b9df3
parent 67270 e86c4a65bb5055e5e785fd88747598e7c740ba31
child 67272 466585d9bd45b51fb11b8384df69d2eb1a4d6352
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
bugs614353
Bug 614353: Make sure the viewport spans the full window height when zoomed out [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2482,16 +2482,20 @@ Tab.prototype = {
 
       if (validW && !validH) {
         viewportH = viewportW * (screenH / screenW);
       } else if (!validW && validH) {
         viewportW = viewportH * (screenW / screenH);
       } 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.
+        viewportH = Math.max(viewportH, screenH * (browser.contentDocumentWidth / screenW));
       }
     }
 
     browser.setWindowSize(viewportW, viewportH);
   },
 
   restoreViewportPosition: function restoreViewportPosition(aOldWidth, aNewWidth) {
     let browser = this._browser;