Bug 1084321 - Remove b2g app meta viewport work-around. r=kats,roc
authorChris Lord <chrislord.net@gmail.com>
Tue, 04 Nov 2014 17:15:30 +0000
changeset 214056 dffbf0a5595585183535eb864b6ed46ad72ec59c
parent 214055 43a51201545a2f950d012c6561be42f06b275885
child 214057 80793ffb4e3c579d0462353e5ef8bfae15880f20
push id51408
push userchrislord.net@gmail.com
push dateWed, 05 Nov 2014 12:34:48 +0000
treeherdermozilla-inbound@dffbf0a55955 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, roc
bugs1084321
milestone36.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 1084321 - Remove b2g app meta viewport work-around. r=kats,roc
dom/base/nsDocument.cpp
layout/generic/test/page_scroll_with_fixed_pos_window.html
layout/generic/test/test_page_scroll_with_fixed_pos.html
layout/reftests/image/background-image-zoom-1-ref.html
layout/reftests/image/background-image-zoom-1.html
layout/reftests/svg/svg-effects-area-zoomed-out-ref.xhtml
layout/reftests/svg/svg-effects-area-zoomed-out.xhtml
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -7723,42 +7723,16 @@ nsDocument::GetViewportInfo(const Screen
       GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly);
       if (handheldFriendly.EqualsLiteral("true")) {
         mViewportType = DisplayWidthHeight;
         return nsViewportInfo(aDisplaySize,
                               defaultScale,
                               /*allowZoom*/true,
                               /*allowDoubleTapZoom*/false);
       }
-
-      // Bug 940036. This is bad. When FirefoxOS was built, apps installed
-      // where not using the AsyncPanZoom code. As a result a lot of apps
-      // in the marketplace does not use it yet and instead are built to
-      // render correctly in FirefoxOS only. For a smooth transition the above
-      // code force installed apps to render as if they have a viewport with
-      // content="width=device-width, height=device-height, user-scalable=no".
-      // This could be safely remove once it is known that most apps in the
-      // marketplace use it and that users does not use an old version of the
-      // app that does not use it.
-      nsCOMPtr<nsIDocShell> docShell(mDocumentContainer);
-      if (docShell && docShell->GetIsApp()) {
-        nsString uri;
-        GetDocumentURI(uri);
-        if (!uri.EqualsLiteral("about:blank")) {
-          nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
-                                          NS_LITERAL_CSTRING("DOM"), this,
-                                          nsContentUtils::eDOM_PROPERTIES,
-                                          "ImplicitMetaViewportTagFallback");
-        }
-        mViewportType = DisplayWidthHeightNoZoom;
-        return nsViewportInfo(aDisplaySize,
-                              defaultScale,
-                              /*allowZoom*/false,
-                              /*allowDoubleTapZoom*/false);
-      }
     }
 
     nsAutoString minScaleStr;
     GetHeaderData(nsGkAtoms::viewport_minimum_scale, minScaleStr);
 
     nsresult errorCode;
     mScaleMinFloat = LayoutDeviceToScreenScale(minScaleStr.ToFloat(&errorCode));
 
--- a/layout/generic/test/page_scroll_with_fixed_pos_window.html
+++ b/layout/generic/test/page_scroll_with_fixed_pos_window.html
@@ -1,11 +1,12 @@
 <!DOCTYPE HTML>
 <html>
 <head>
+  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
   <title>Scrolling by pages with fixed-pos headers and footers</title>
   <style>
   .fp { position:fixed; left:0; width:100%; }
   .fp2 { position:fixed; left:0; width:100%; }
   </style>
 </head>
 <body onscroll="didScroll()" onload="test()">
 <div class="fp" id="top" style="top:0; height:10px; background:yellow;"></div>
--- a/layout/generic/test/test_page_scroll_with_fixed_pos.html
+++ b/layout/generic/test/test_page_scroll_with_fixed_pos.html
@@ -1,11 +1,12 @@
 <!DOCTYPE HTML>
 <html>
 <head>
+  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
   <title>Scrolling by pages with fixed-pos headers and footers</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <p id="display"></p>
 <script class="testbody">
 SimpleTest.waitForExplicitFinish();
--- a/layout/reftests/image/background-image-zoom-1-ref.html
+++ b/layout/reftests/image/background-image-zoom-1-ref.html
@@ -1,21 +1,23 @@
 <!DOCTYPE HTML>
 <!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/licenses/publicdomain/
     -->
 <html>
 <head>
+<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
 <title>reference background-image-rendering: -moz-crisp-edges</title>
 <style>
 html
 { 
 background-image: url('big.png');
 background-attachment:fixed;
 background-position: 20px 20px;
 background-repeat: no-repeat;
+overflow: hidden;
 }
 </style>
 </head>
 <body>
 </body>
 </html>
--- a/layout/reftests/image/background-image-zoom-1.html
+++ b/layout/reftests/image/background-image-zoom-1.html
@@ -1,22 +1,24 @@
 <!DOCTYPE HTML>
 <!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/licenses/publicdomain/
     -->
 <html reftest-zoom="5">
 <head>
+<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
 <title>test background-image-rendering: -moz-crisp-edges</title>
 <style>
 html
 { 
 background-image: url('small.png');
 image-rendering: -moz-crisp-edges;
 background-attachment:fixed;
 background-position: 4px 4px;
 background-repeat: no-repeat;
+overflow: hidden;
 }
 </style>
 </head>
 <body>
 </body>
 </html>
--- a/layout/reftests/svg/svg-effects-area-zoomed-out-ref.xhtml
+++ b/layout/reftests/svg/svg-effects-area-zoomed-out-ref.xhtml
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" reftest-zoom="0.6">
 <head>
+  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
   <title>Test for bug 541270 (SVG Effects area)</title>
   <style type="text/css">
   html, body, div { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
   /* ick, filters can't be display: none or inside of something display:none! */
   svg { display: block; height: 0; }
   </style>
 </head>
 <body>
--- a/layout/reftests/svg/svg-effects-area-zoomed-out.xhtml
+++ b/layout/reftests/svg/svg-effects-area-zoomed-out.xhtml
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" reftest-zoom="0.6">
 <head>
+  <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no" />
   <title>Test for bug 541270 (SVG Effects area)</title>
   <style type="text/css">
   html, body, div { display: block; width: 100%; height: 100%; border: none; margin: 0; padding: 0; }
   /* ick, filters can't be display: none or inside of something display:none! */
   svg { display: block; height: 0; }
   </style>
 </head>
 <body>