Bug 596952 - Temporary hack to fix the viewport in local tabs [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 16 Sep 2010 13:17:09 -0700
changeset 66664 4c69e6c4e106d86e6aedf57ae399f1f14c0122be
parent 66663 0407a246fc73338a8252f36dcecebd6f61a1de81
child 66665 1596d6735c37c14654303daa0bc07782e28e8caf
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
bugs596952
Bug 596952 - Temporary hack to fix the viewport in local tabs [r=mfinkle]
mobile/chrome/content/content.js
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -574,16 +574,21 @@ let ViewportHandler = {
     let windowUtils = Util.getWindowUtils(content);
     let handheldFriendly = windowUtils.getDocumentMetadata("HandheldFriendly");
     if (handheldFriendly == "true")
       return { defaultZoom: dpiScale, autoSize: true };
 
     if (content.document instanceof XULDocument)
       return { defaultZoom: 1.0, autoSize: true, allowZoom: false };
 
+    // HACK: Since we can't set the scale in local tabs (bug 597081), we force
+    // them to device-width and scale=1 so they will lay out reasonably.
+    if (Util.isParentProcess())
+      return { defaultZoom: 1.0, autoSize: true, allowZoom: false };
+
     // viewport details found here
     // http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
     // http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
 
     // Note: These values will be NaN if parseFloat or parseInt doesn't find a number.
     // Remember that NaN is contagious: Math.max(1, NaN) == Math.min(1, NaN) == NaN.
     let viewportScale = parseFloat(windowUtils.getDocumentMetadata("viewport-initial-scale"));
     let viewportMinScale = parseFloat(windowUtils.getDocumentMetadata("viewport-minimum-scale"));