Bug 596952 - Temporary hack to fix the viewport in local tabs [r=mfinkle]
--- 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"));