Bug 602420 - getPageZoomLevel should not return Infinity [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 08 Oct 2010 14:38:26 -0700
changeset 66810 d84291ff6b00ce7463a6cf85f45a62cd04d512b4
parent 66809 15ae5c20e5cb9c653a0af66af5849160d0ae6ba8
child 66811 71d002b5a0495dc8f3127c2258634dd4adb2cdbb
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
bugs602420
Bug 602420 - getPageZoomLevel should not return Infinity [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2548,16 +2548,19 @@ Tab.prototype = {
     if (threshold < pageZoom && pageZoom < 1)
       pageZoom = 1;
 
     return this.clampZoomLevel(pageZoom);
   },
 
   getPageZoomLevel: function getPageZoomLevel() {
     let browserW = this._browser.contentDocumentWidth;
+    if (browserW == 0)
+      return 1.0;
+
     return this._browser.getBoundingClientRect().width / browserW;
   },
 
   get allowZoom() {
     return this.metadata.allowZoom;
   },
 
   updateThumbnail: function updateThumbnail() {