Bug 1126230 part 8 - Remove fullscreen override and related test. r=dbaron

This commit is contained in:
Xidorn Quan 2015-10-02 16:34:09 +10:00
parent dbaf72f4f9
commit 5bfdc593ef
8 changed files with 0 additions and 180 deletions

View File

@ -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>

View File

@ -46,7 +46,6 @@ support-files =
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

View File

@ -28,7 +28,6 @@ SimpleTest.requestFlakyTimeout("untriaged");
// 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",

View File

@ -2239,11 +2239,6 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument,
}
}
sheet = nsLayoutStylesheetCache::FullScreenOverrideSheet();
if (sheet) {
styleSet->PrependStyleSheet(nsStyleSet::eOverrideSheet, sheet);
}
if (!aDocument->IsSVGDocument()) {
// !!! IMPORTANT - KEEP THIS BLOCK IN SYNC WITH
// !!! SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded.

View File

@ -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;
}

View File

@ -6,7 +6,6 @@ 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)

View File

@ -157,13 +157,6 @@ nsLayoutStylesheetCache::QuirkSheet()
return gStyleCache->mQuirkSheet;
}
CSSStyleSheet*
nsLayoutStylesheetCache::FullScreenOverrideSheet()
{
EnsureGlobal();
return gStyleCache->mFullScreenOverrideSheet;
}
CSSStyleSheet*
nsLayoutStylesheetCache::SVGSheet()
{
@ -316,7 +309,6 @@ nsLayoutStylesheetCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf
MEASURE(mCounterStylesSheet);
MEASURE(mDesignModeSheet);
MEASURE(mFormsSheet);
MEASURE(mFullScreenOverrideSheet);
MEASURE(mHTMLSheet);
MEASURE(mMathMLSheet);
MEASURE(mMinimalXULSheet);
@ -357,8 +349,6 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache()
// 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",

View File

@ -44,7 +44,6 @@ class nsLayoutStylesheetCache final
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();
@ -92,7 +91,6 @@ private:
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;