Bug 1126230 part 9 - Remove fullscreen override and related test. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 07 Oct 2015 14:04:32 +1100
changeset 287189 74f41e0d78e4e1ff1156a830ab8db65ff6a65ef9
parent 287188 e6bc3e58c8acdafab75f38ddd2b2bc992bb01895
child 287190 b45bd6bd7d574f633a67b3fdf0256e6ae7b57d36
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs1126230
milestone44.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 1126230 part 9 - Remove fullscreen override and related test. r=dbaron
dom/html/test/file_fullscreen-ancestor-stacking-context.html
dom/html/test/mochitest.ini
dom/html/test/test_fullscreen-api.html
layout/base/nsDocumentViewer.cpp
layout/style/full-screen-override.css
layout/style/jar.mn
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsLayoutStylesheetCache.h
deleted file mode 100644
--- a/dom/html/test/file_fullscreen-ancestor-stacking-context.html
+++ /dev/null
@@ -1,134 +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)",
-  "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",
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2234,21 +2234,16 @@ nsDocumentViewer::CreateStyleSet(nsIDocu
 
   if (!shouldOverride) {
     sheet = nsLayoutStylesheetCache::ScrollbarsSheet();
     if (sheet) {
       styleSet->PrependStyleSheet(nsStyleSet::eAgentSheet, sheet);
     }
   }
 
-  sheet = nsLayoutStylesheetCache::FullScreenOverrideSheet();
-  if (sheet) {
-    styleSet->PrependStyleSheet(nsStyleSet::eOverrideSheet, sheet);
-  }
-
   if (!aDocument->IsSVGDocument()) {
     // !!! IMPORTANT - KEEP THIS BLOCK IN SYNC WITH
     // !!! SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded.
 
     // SVGForeignObjectElement::BindToTree calls SVGDocument::
     // EnsureNonSVGUserAgentStyleSheetsLoaded to loads these UA sheet
     // on-demand. (Excluding the quirks sheet, which should never be loaded for
     // an SVG document, and excluding xul.css which will be loaded on demand by
deleted file mode 100644
--- a/layout/style/full-screen-override.css
+++ /dev/null
@@ -1,26 +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'? */
-  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
@@ -153,23 +153,16 @@ nsLayoutStylesheetCache::XULSheet()
 CSSStyleSheet*
 nsLayoutStylesheetCache::QuirkSheet()
 {
   EnsureGlobal();
   return gStyleCache->mQuirkSheet;
 }
 
 CSSStyleSheet*
-nsLayoutStylesheetCache::FullScreenOverrideSheet()
-{
-  EnsureGlobal();
-  return gStyleCache->mFullScreenOverrideSheet;
-}
-
-CSSStyleSheet*
 nsLayoutStylesheetCache::SVGSheet()
 {
   EnsureGlobal();
   return gStyleCache->mSVGSheet;
 }
 
 CSSStyleSheet*
 nsLayoutStylesheetCache::MathMLSheet()
@@ -311,17 +304,16 @@ nsLayoutStylesheetCache::SizeOfIncluding
   #define MEASURE(s) n += s ? s->SizeOfIncludingThis(aMallocSizeOf) : 0;
 
   MEASURE(mChromePreferenceSheet);
   MEASURE(mContentEditableSheet);
   MEASURE(mContentPreferenceSheet);
   MEASURE(mCounterStylesSheet);
   MEASURE(mDesignModeSheet);
   MEASURE(mFormsSheet);
-  MEASURE(mFullScreenOverrideSheet);
   MEASURE(mHTMLSheet);
   MEASURE(mMathMLSheet);
   MEASURE(mMinimalXULSheet);
   MEASURE(mNoFramesSheet);
   MEASURE(mNoScriptSheet);
   MEASURE(mNumberControlSheet);
   MEASURE(mQuirkSheet);
   MEASURE(mSVGSheet);
@@ -352,18 +344,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);
--- a/layout/style/nsLayoutStylesheetCache.h
+++ b/layout/style/nsLayoutStylesheetCache.h
@@ -39,17 +39,16 @@ class nsLayoutStylesheetCache final
   static mozilla::CSSStyleSheet* NumberControlSheet();
   static mozilla::CSSStyleSheet* UserContentSheet();
   static mozilla::CSSStyleSheet* UserChromeSheet();
   static mozilla::CSSStyleSheet* UASheet();
   static mozilla::CSSStyleSheet* HTMLSheet();
   static mozilla::CSSStyleSheet* MinimalXULSheet();
   static mozilla::CSSStyleSheet* XULSheet();
   static mozilla::CSSStyleSheet* QuirkSheet();
-  static mozilla::CSSStyleSheet* FullScreenOverrideSheet();
   static mozilla::CSSStyleSheet* SVGSheet();
   static mozilla::CSSStyleSheet* MathMLSheet();
   static mozilla::CSSStyleSheet* CounterStylesSheet();
   static mozilla::CSSStyleSheet* NoScriptSheet();
   static mozilla::CSSStyleSheet* NoFramesSheet();
   static mozilla::CSSStyleSheet* ChromePreferenceSheet(nsPresContext* aPresContext);
   static mozilla::CSSStyleSheet* ContentPreferenceSheet(nsPresContext* aPresContext);
   static mozilla::CSSStyleSheet* ContentEditableSheet();
@@ -87,17 +86,16 @@ private:
   static mozilla::StaticRefPtr<nsLayoutStylesheetCache> gStyleCache;
   static mozilla::css::Loader* gCSSLoader;
   nsRefPtr<mozilla::CSSStyleSheet> mChromePreferenceSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mContentEditableSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mContentPreferenceSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mCounterStylesSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mDesignModeSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mFormsSheet;
-  nsRefPtr<mozilla::CSSStyleSheet> mFullScreenOverrideSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mHTMLSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mMathMLSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mMinimalXULSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mNoFramesSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mNoScriptSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mNumberControlSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mQuirkSheet;
   nsRefPtr<mozilla::CSSStyleSheet> mSVGSheet;