mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 556619 - portrait mode - about:config rows shorter than a touchheight [r=vingtetun]
This commit is contained in:
parent
430ff0b350
commit
99c2ca9cb1
@ -113,17 +113,20 @@ let Util = {
|
||||
return makeURI(url, null, makeURI(base)).spec;
|
||||
},
|
||||
|
||||
contentIsHandheld: function contentIsHandheld(browser) {
|
||||
getViewportMetadata: function getViewportMetadata(browser) {
|
||||
let doctype = browser.contentDocument.doctype;
|
||||
if (doctype && /(WAP|WML|Mobile)/.test(doctype.publicId))
|
||||
return {reason: "doctype", result: true};
|
||||
return { reason: "doctype", result: true, scale: 1.0 };
|
||||
|
||||
let windowUtils = browser.contentWindow
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let handheldFriendly = windowUtils.getDocumentMetadata("HandheldFriendly");
|
||||
if (handheldFriendly == "true")
|
||||
return {reason: "handheld", result: true};
|
||||
return { reason: "handheld", result: true, scale: 1.0 };
|
||||
|
||||
if (browser.contentDocument instanceof XULDocument)
|
||||
return { reason: "chrome", result: true, scale: 1.0, autoSize: true, allowZoom: false };
|
||||
|
||||
// viewport details found here
|
||||
// http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
|
||||
@ -147,11 +150,12 @@ let Util = {
|
||||
scale: viewportScale,
|
||||
width: viewportWidth,
|
||||
height: viewportHeight,
|
||||
autoSize: viewportWidthStr == "device-width" || viewportHeightStr == "device-height"
|
||||
autoSize: viewportWidthStr == "device-width" || viewportHeightStr == "device-height",
|
||||
allowZoom: windowUtils.getDocumentMetadata("viewport-user-scalable") != "no"
|
||||
}
|
||||
}
|
||||
|
||||
return {reason: "", result: false};
|
||||
return { reason: "", result: false, allowZoom: true };
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user