Bug 1126230 part 10 - Remove fullscreen override and related test. draft
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 07 Sep 2015 15:18:04 +1000
changeset 290876 a76e20de1104f0c5256581393995b513d29965f0
parent 290875 c3882e1d29aebc5048ffc576915164d42c77f285
child 290877 2b00eb9728c599b45ca24ca23f693283d79973cc
push id5184
push userxquan@mozilla.com
push dateTue, 08 Sep 2015 06:21:01 +0000
bugs1126230
milestone43.0a1
Bug 1126230 part 10 - Remove fullscreen override and related test.
dom/html/test/file_fullscreen-ancestor-stacking-context.html
dom/html/test/mochitest.ini
dom/html/test/test_fullscreen-api.html
layout/style/full-screen-override.css
layout/style/jar.mn
layout/style/nsLayoutStylesheetCache.cpp
deleted file mode 100644
--- a/dom/html/test/file_fullscreen-ancestor-stacking-context.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1056203
--->
-<head>
-  <title>Test for Bug 1056203</title>
-</head>
-<body>
-
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1056203">Mozilla Bug 1056203</a>
-<p id="display">
-  <div id="grandparent">
-    <div id="parent">
-      <div id="fullscreenElem">
-        <div id="child"></div>
-      </div>
-    </div>
-  </div>
-</p>
-<pre id="test">
-<script type="application/javascript;version=1.7">
-
-/** Test for Bug 1056203 **/
-/* This test ensures that the ancestors of a full-screened element cannot be
-   restyled to create a stacking context, even with !important. */
-
-/* NOTE: The following hash should include each of the properties from
-   layout/style/full-screen-override.css (except that this list uses the DOM
-   versions of the property names -- e.g. "zIndex" instead of "z-index").
-   Both lists should include every property that is able to induce an element
-   to form a stacking context. */
-const gPropertyTestDecls = {
-//"domPropName": "prop-name: some-non-initial-value",
-  "zIndex":      "z-index: 5",
-  "opacity":     "opacity: 0.8",
-  "mask":        "mask: url(#mymask)",
-  "clip":        "clip: rect(0 0 0 0)",
-  "clipPath":    "clip-path: url(#mypath)",
-  "filter":      "filter: url(#myfilter)",
-  "transform":   "transform: translate(0)",
-// XXXdholbert The "will-change" line in full-screen-override.css is only
-// parsed and honored if "layout.css.will-change.enabled" is turned on
-// *at startup time* (so, flipping it here with SpecialPowers wouldn't be
-// sufficient). So, we won't get the right behavior for 'will-change' here
-// until it's enabled by default (bug 961871). This line can be uncommented
-// when that happens:
-//  "willChange": "will-change: transform"
-};
-
-// populated in populateInitialVals
-let gPropertyInitialVals = {};
-
-function begin() {
-  populateInitialVals();
-
-  // FIRST: Assert that the properties in gPropertyTestDecls can be set
-  // on each of our tested elements, before we enter full-screen mode.
-  var timeDescrip = "not yet fullscreen";
-  testPropertiesOnElem("grandparent", true);
-  testPropertiesOnElem("parent", true);
-  testPropertiesOnElem("fullscreenElem", true);
-  testPropertiesOnElem("child", true);
-
-  document.addEventListener("mozfullscreenchange", handleFullscreen, false);
-  fullscreenElem.mozRequestFullScreen();
-}
-
-function handleFullscreen(e) {
-  opener.ok(document.mozFullScreen, "should've entered full-screen mode");
-
-  // SECOND: Assert that the properties in gPropertyTestDecls can *NOT* be
-  // set (their decls have no effect) on ancestors of the full-screen elem.
-  testPropertiesOnElem("parent", false);
-  testPropertiesOnElem("grandparent", false);
-  testPropertiesOnElem("fullscreenElem", true);
-  testPropertiesOnElem("child", true);
-
-  // Un-register listener, so we aren't re-triggered when document is torn
-  // down & taken out of full-screen mode:
-  document.removeEventListener("mozfullscreenchange", handleFullscreen);
-
-  // We're done! On to the next test:
-  opener.nextTest();
-};
-
-// Populates gPropertyTestDecls with the initial values of each property
-// in gPropertyTestDecls (based on document.documentElement's computed style)
-function populateInitialVals() {
-  // We'll read the initial values off of document.documentElement.
-  let cs = window.getComputedStyle(document.documentElement, "");
-  for (propName in gPropertyTestDecls) {
-    opener.ok(propName in cs,
-              "property '" + propName + "' used in this test should " +
-              "exist in computed style");
-    gPropertyInitialVals[propName] = cs[propName];
-  }
-}
-
-// For the element with id |elemId|, this method asserts that the property
-// decls in gPropertyTestDecls either *do* or *do not* have an effect on the
-// element's computed style, depending on the argument |isPropertyModifyable|.
-// The decls are tested both with & without "!important".
-function testPropertiesOnElem(elemId, isPropertyModifyable) {
-  const elem = document.getElementById(elemId);
-  opener.ok(elem, "expecting to find element with ID '" + elemId + "'");
-  const testFunc = isPropertyModifyable ? opener.isnot : opener.is;
-
-  for (propName in gPropertyTestDecls) {
-    let msg = elemId + ".style." + propName +" should ";
-    if (!isPropertyModifyable) {
-      msg += "NOT ";
-    }
-    msg += "be allowed to change away from initial value, ";
-    msg += document.mozFullScreen ? "after" : "before";
-    msg += " entering full-screen mode";
-
-    let decl = gPropertyTestDecls[propName];
-
-    // See if the test decl has any effect on computed style:
-    elem.setAttribute("style", decl);
-    testFunc(window.getComputedStyle(elem, "")[propName],
-             gPropertyInitialVals[propName],
-             msg);
-
-    // See if the test decl has any effect on computed style, w/ "!important":
-    elem.setAttribute("style", decl + " !important");
-    testFunc(window.getComputedStyle(elem, "")[propName],
-             gPropertyInitialVals[propName],
-             msg + " (with !important)");
-
-    elem.removeAttribute("style"); // clean up
-  }
-}
-
-</script>
-</pre>
-</body>
-
-</html>
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -41,17 +41,16 @@ support-files =
   file_bug209275_1.html
   file_bug209275_2.html
   file_bug209275_3.html
   file_bug297761.html
   file_bug417760.png
   file_bug893537.html
   file_formSubmission_img.jpg
   file_formSubmission_text.txt
-  file_fullscreen-ancestor-stacking-context.html
   file_fullscreen-api-keys.html
   file_fullscreen-api.html
   file_fullscreen-denied-inner.html
   file_fullscreen-denied.html
   file_fullscreen-esc-context-menu.html
   file_fullscreen-esc-exit-inner.html
   file_fullscreen-esc-exit.html
   file_fullscreen-hidden.html
--- a/dom/html/test/test_fullscreen-api.html
+++ b/dom/html/test/test_fullscreen-api.html
@@ -23,17 +23,16 @@
 
 /** Tests for Bug 545812 **/
 SimpleTest.requestFlakyTimeout("untriaged");
 
 // Run the tests which go full-screen in new windows, as mochitests normally
 // run in an iframe, which by default will not have the allowfullscreen
 // attribute set, so full-screen won't work.
 var gTestWindows = [
-  "file_fullscreen-ancestor-stacking-context.html",
   "file_fullscreen-multiple.html",
   "file_fullscreen-rollback.html",
   "file_fullscreen-esc-context-menu.html",
   "file_fullscreen-esc-exit.html",
   "file_fullscreen-denied.html",
   "file_fullscreen-api.html",
   "file_fullscreen-api-keys.html",
   "file_fullscreen-plugins.html",
deleted file mode 100644
--- a/layout/style/full-screen-override.css
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-*|*:-moz-full-screen-ancestor {
-  /* Ancestors of a full-screen element should not induce stacking contexts
-     that would prevent the full-screen element from being on top. */
-  z-index: initial !important;
-  /* Ancestors of a full-screen element should not be partially transparent,
-     since that would apply to the full-screen element and make the page visible
-     behind it. It would also create a pseudo-stacking-context that would let content
-     draw on top of the full-screen element. */
-  opacity: initial !important;
-  /* Ancestors of a full-screen element should not apply SVG masking, clipping, or
-     filtering, since that would affect the full-screen element and create a pseudo-
-     stacking context. */
-  mask: initial !important;
-  clip-path: initial !important;
-  filter: initial !important;
-  clip: initial !important;
-  transform: initial !important;
-  transform-style: initial !important;
-  /* FIXME: do we need to worry about 'overflow'? */
-}
-
-/* XXXdholbert This '@supports' wrapper should be removed once we remove
-   support for the pref 'layout.css.will-change.enabled'. (This CSS rule should
-   then be merged with the main rule up above.)  */
-@supports (will-change: initial) {
-  *|*:-moz-full-screen-ancestor {
-    will-change: initial !important;
-  }
-}
-
--- a/layout/style/jar.mn
+++ b/layout/style/jar.mn
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
 *  res/ua.css    (ua.css)
    res/html.css    (html.css)
    res/quirk.css    (quirk.css)
-   res/full-screen-override.css    (full-screen-override.css)
    res/plaintext.css     (plaintext.css)
    res/viewsource.css    (viewsource.css)
    res/counterstyles.css (counterstyles.css)
    res/noscript.css (noscript.css)
    res/noframes.css (noframes.css)
 *  res/forms.css    (forms.css)
    res/number-control.css    (number-control.css)
    res/arrow.gif        (arrow.gif)
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -339,18 +339,16 @@ nsLayoutStylesheetCache::nsLayoutStylesh
   }
 
   InitFromProfile();
 
   // And make sure that we load our UA sheets.  No need to do this
   // per-profile, since they're profile-invariant.
   LoadSheetURL("resource://gre-resources/counterstyles.css",
                mCounterStylesSheet, true);
-  LoadSheetURL("resource://gre-resources/full-screen-override.css",
-               mFullScreenOverrideSheet, true);
   LoadSheetURL("chrome://global/content/minimal-xul.css",
                mMinimalXULSheet, true);
   LoadSheetURL("resource://gre-resources/quirk.css",
                mQuirkSheet, true);
   LoadSheetURL("resource://gre/res/svg.css",
                mSVGSheet, true);
   LoadSheetURL("chrome://global/content/xul.css",
                mXULSheet, true);