Bug 763916 - Fix test for missing viewport metadata [r=kats]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 12 Jun 2012 10:15:16 -0700
changeset 96489 7beb4319143785785edd6196f3a0519583c39b61
parent 96488 22796d93c42e7b8b872adfee86af3945816aac2e
child 96490 4215e09508da24b83d483691dcf7f7aaa1d17bc5
push id10558
push usermbrubeck@mozilla.com
push dateTue, 12 Jun 2012 17:16:59 +0000
treeherdermozilla-inbound@7beb43191437 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs763916
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 763916 - Fix test for missing viewport metadata [r=kats]
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3733,21 +3733,19 @@ var ViewportHandler = {
     let widthStr = windowUtils.getDocumentMetadata("viewport-width");
     let heightStr = windowUtils.getDocumentMetadata("viewport-height");
     let width = this.clamp(parseInt(widthStr), kViewportMinWidth, kViewportMaxWidth);
     let height = this.clamp(parseInt(heightStr), kViewportMinHeight, kViewportMaxHeight);
 
     let allowZoomStr = windowUtils.getDocumentMetadata("viewport-user-scalable");
     let allowZoom = !/^(0|no|false)$/.test(allowZoomStr); // WebKit allows 0, "no", or "false"
 
-
-    if (scale == NaN && minScale == NaN && maxScale == NaN && allowZoomStr == "" && widthStr == "" && heightStr == "") {
+    if (isNaN(scale) && isNaN(minScale) && isNaN(maxScale) && allowZoomStr == "" && widthStr == "" && heightStr == "") {
       // 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 };
 
       let doctype = aWindow.document.doctype;
       if (doctype && /(WAP|WML|Mobile)/.test(doctype.publicId))
         return { defaultZoom: 1, autoSize: true, allowZoom: true, autoScale: true };
     }