Bug 597281 - Cannot pinch to zoom during loading [r=mbrubeck]
authorBenjamin Stover <bstover@mozilla.com>
Fri, 17 Sep 2010 10:59:09 -0700
changeset 66666 9f1a6c031b133ccada78ad82017a23007e9733b0
parent 66665 1596d6735c37c14654303daa0bc07782e28e8caf
child 66667 75473be322cf5815ec6f51615309017a52044f8c
push id19389
push userffxbld
push dateWed, 06 Apr 2011 21:33:21 +0000
treeherdermozilla-central@8e9f90073a20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs597281
Bug 597281 - Cannot pinch to zoom during loading [r=mbrubeck]
mobile/chrome/content/browser.js
mobile/chrome/content/content.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -56,16 +56,18 @@ function getBrowser() {
   return Browser.selectedBrowser;
 }
 
 const kDefaultBrowserWidth = 980;
 const kBrowserFormZoomLevelMin = 1.0;
 const kBrowserFormZoomLevelMax = 2.0;
 const kBrowserViewZoomLevelPrecision = 10000;
 
+const kDefaultMetadata = { allowZoom: true };
+
 // Override sizeToContent in the main window. It breaks things (bug 565887)
 window.sizeToContent = function() {
   Components.utils.reportError("window.sizeToContent is not allowed in this window");
 }
 
 #ifdef MOZ_CRASH_REPORTER
 XPCOMUtils.defineLazyServiceGetter(this, "CrashReporter",
   "@mozilla.org/xre/app-info;1", "nsICrashReporter");
@@ -2211,17 +2213,17 @@ Tab.prototype = {
   },
 
   /** Update browser size when the metadata or the window size changes. */
   updateViewportSize: function updateViewportSize() {
     let browser = this._browser;
     if (!browser)
       return;
 
-    let metaData = this.metaData || {};
+    let metaData = this.metaData || kDefaultMetadata;
     if (!metaData.autoSize) {
       let screenW = window.innerWidth;
       let screenH = window.innerHeight;
       let viewportW = metaData.width;
       let viewportH = metaData.height;
 
       // If (scale * width) < device-width, increase the width (bug 561413).
       let maxInitialZoom = metaData.defaultZoom || metaData.maxZoom;
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -551,17 +551,17 @@ let ViewportHandler = {
         if (!this.metadata)
           this.updateMetadata();
         break;
     }
   },
 
   resetMetadata: function resetMetadata() {
     this.metadata = null;
-    sendAsyncMessage("Browser:ViewportMetadata", {});
+    sendAsyncMessage("Browser:ViewportMetadata", null);
   },
 
   updateMetadata: function updateMetadata() {
     this.metadata = this.getViewportMetadata();
     sendAsyncMessage("Browser:ViewportMetadata", this.metadata);
   },
 
   getViewportMetadata: function getViewportMetadata() {