Bug 597144 - "Set viewport width and height if both are specified in meta tag" [r=mark.finkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Thu, 16 Sep 2010 12:30:00 -0400
changeset 66739 f2e06a32551d1d45f64439b4f810bd6b16bdd18c
parent 66738 2d41fb55edbf298ccf0c36fd6ebb47b218d1f346
child 66740 41d8616dd6da336fb3fbc9cbe6c487eb71182ad2
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs597144
Bug 597144 - "Set viewport width and height if both are specified in meta tag" [r=mark.finkle]
mobile/chrome/content/browser.js
mobile/chrome/tests/browser_viewport_04.html
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2384,17 +2384,17 @@ Tab.prototype = {
 
       let validW = viewportW > 0;
       let validH = viewportH > 0;
 
       if (validW && !validH) {
         viewportH = viewportW * (screenH / screenW);
       } else if (!validW && validH) {
         viewportW = viewportH * (screenW / screenH);
-      } else {
+      } else if (!validW && !validH) {
         viewportW = kDefaultBrowserWidth;
         viewportH = kDefaultBrowserWidth * (screenH / screenW);
       }
 
       browser.setWindowSize(viewportW, viewportH);
 
       if (aRatio) {
         let pos = browser.getPosition();
--- a/mobile/chrome/tests/browser_viewport_04.html
+++ b/mobile/chrome/tests/browser_viewport_04.html
@@ -1,12 +1,12 @@
 <html>
 <head>
     <title>Browser Viewport Page 04</title>
-    <meta name="viewport" content="width=200"/>
+    <meta name="viewport" content="width=200,height=500"/>
 
     <!--
     Expected width calculation:
       width = 200px
 
     Expected scale calculation:
       make fullscreen for expected width = 200 (800 / 200 = 4.00)
     -->