diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index c24c6c06adb0..3beee8ed00e7 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -174,14 +174,6 @@ struct ViewportInfo // Whether or not the user can zoom in and out on the page. Default is true. bool allowZoom; - - // This is a holdover from e10s fennec, and might be removed in the future. - // It's a hack to work around bugs that didn't allow zooming of documents - // from within the parent process. It is still used in native Fennec for XUL - // documents, but it should probably be removed. - // Currently, from, within GetViewportInfo(), This is only set to false - // if the document is a XUL document. - bool autoScale; }; struct EventNameMapping diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 28cf0595ac0e..2cfdfbc899c3 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -5055,7 +5055,6 @@ nsContentUtils::GetViewportInfo(nsIDocument *aDocument) ret.defaultZoom = 1.0; ret.autoSize = true; ret.allowZoom = true; - ret.autoScale = true; // If the docType specifies that we are on a site optimized for mobile, // then we want to return specially crafted defaults for the viewport info. @@ -5077,11 +5076,6 @@ nsContentUtils::GetViewportInfo(nsIDocument *aDocument) } } - if (aDocument->IsXUL()) { - ret.autoScale = false; - return ret; - } - nsAutoString handheldFriendly; aDocument->GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 0f2f255d7a30..e791f1355cb0 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3079,16 +3079,16 @@ Tab.prototype = { aMetadata.allowZoom = true; aMetadata.minZoom = aMetadata.maxZoom = NaN; } - if (aMetadata && aMetadata.autoScale) { - let scaleRatio = aMetadata.scaleRatio = ViewportHandler.getScaleRatio(); - if ("defaultZoom" in aMetadata && aMetadata.defaultZoom > 0) - aMetadata.defaultZoom *= scaleRatio; - if ("minZoom" in aMetadata && aMetadata.minZoom > 0) - aMetadata.minZoom *= scaleRatio; - if ("maxZoom" in aMetadata && aMetadata.maxZoom > 0) - aMetadata.maxZoom *= scaleRatio; - } + let scaleRatio = aMetadata.scaleRatio = ViewportHandler.getScaleRatio(); + + if ("defaultZoom" in aMetadata && aMetadata.defaultZoom > 0) + aMetadata.defaultZoom *= scaleRatio; + if ("minZoom" in aMetadata && aMetadata.minZoom > 0) + aMetadata.minZoom *= scaleRatio; + if ("maxZoom" in aMetadata && aMetadata.maxZoom > 0) + aMetadata.maxZoom *= scaleRatio; + ViewportHandler.setMetadataForDocument(this.browser.contentDocument, aMetadata); this.updateViewportSize(gScreenWidth); this.sendViewportMetadata(); @@ -4547,12 +4547,8 @@ var ViewportHandler = { * height (optional int): The CSS viewport height in px. * autoSize (boolean): Resize the CSS viewport when the window resizes. * allowZoom (boolean): Let the user zoom in or out. - * autoScale (boolean): Adjust the viewport properties to account for display density. */ getViewportMetadata: function getViewportMetadata(aWindow) { - if (aWindow.document instanceof XULDocument) - return { defaultZoom: 1, autoSize: true, allowZoom: false, autoScale: false }; - let windowUtils = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); // viewport details found here @@ -4577,11 +4573,11 @@ var ViewportHandler = { // Only check for HandheldFriendly if we don't have a viewport meta tag let handheldFriendly = windowUtils.getDocumentMetadata("HandheldFriendly"); if (handheldFriendly == "true") - return { defaultZoom: 1, autoSize: true, allowZoom: true, autoScale: true }; + return { defaultZoom: 1, autoSize: true, allowZoom: true }; let doctype = aWindow.document.doctype; if (doctype && /(WAP|WML|Mobile)/.test(doctype.publicId)) - return { defaultZoom: 1, autoSize: true, allowZoom: true, autoScale: true }; + return { defaultZoom: 1, autoSize: true, allowZoom: true }; } scale = this.clamp(scale, kViewportMinScale, kViewportMaxScale); @@ -4599,8 +4595,7 @@ var ViewportHandler = { width: width, height: height, autoSize: autoSize, - allowZoom: allowZoom, - autoScale: true + allowZoom: allowZoom }; }, @@ -4653,7 +4648,6 @@ var ViewportHandler = { return { autoSize: false, allowZoom: true, - autoScale: true, scaleRatio: ViewportHandler.getScaleRatio() }; }