Bug 556619 - portrait mode - about:config rows shorter than a touchheight [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Mon, 12 Apr 2010 23:34:54 -0400
changeset 49668 1301c39f073cbf3dbffed91c96fee27eafe7362b
parent 49667 0df295450c44ddfe26285d3027ef138cc41ca54e
child 49669 d38053378002c83b469f2d68ddcb31bc5cb9c572
push id15027
push useredward.lee@engineering.uiuc.edu
push dateThu, 12 Aug 2010 09:51:47 +0000
treeherderautoland@cdfff833edf9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs556619
Bug 556619 - portrait mode - about:config rows shorter than a touchheight [r=vingtetun]
toolkit/content/Geometry.jsm
--- a/toolkit/content/Geometry.jsm
+++ b/toolkit/content/Geometry.jsm
@@ -108,27 +108,30 @@ let Util = {
       return null;
   },
 
   makeURLAbsolute: function makeURLAbsolute(base, url) {
     // Note:  makeURI() will throw if url is not a valid URI
     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
     // http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html
     
     let viewportScale = parseFloat(windowUtils.getDocumentMetadata("viewport-initial-scale"));
     let viewportWidthStr = windowUtils.getDocumentMetadata("viewport-width");
     let viewportHeightStr = windowUtils.getDocumentMetadata("viewport-height");
@@ -142,21 +145,22 @@ let Util = {
 
     if (viewportScale > 0 || viewportWidth > 0 || viewportHeight > 0) {
       return {
         reason: "viewport",
         result: true,
         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 };
   },
 
   /**
    * Determines whether a home page override is needed.
    * Returns:
    *  "new profile" if this is the first run with a new profile.
    *  "new version" if this is the first run with a build with a different
    *                      Gecko milestone (i.e. right after an upgrade).