Backed out changeset d23f209ada8b (bug 1603455) for causing failures in test_fullscreen-api.html

--HG--
extra : rebase_source : 7b7990746d3884eeced2404ed9bc78590db4b77c
This commit is contained in:
Noemi Erli 2019-12-12 23:49:35 +02:00
Родитель 662a021b39
Коммит 2b5af87228
30 изменённых файлов: 237 добавлений и 13 удалений

Просмотреть файл

@ -102,6 +102,22 @@ if (
}); });
} }
if (!Services.prefs.getBoolPref("full-screen-api.unprefix.enabled")) {
whitelist.push(
{
sourceName: /(?:res|gre-resources)\/(ua|html)\.css$/i,
errorMessage: /Unknown pseudo-class .*\bfullscreen\b/i,
isFromDevTools: false,
},
{
// PDFjs is futureproofing its pseudoselectors, and those rules are dropped.
sourceName: /web\/viewer\.css$/i,
errorMessage: /Unknown pseudo-class .*\bfullscreen\b/i,
isFromDevTools: false,
}
);
}
if (!Services.prefs.getBoolPref("layout.css.scrollbar-width.enabled")) { if (!Services.prefs.getBoolPref("layout.css.scrollbar-width.enabled")) {
whitelist.push({ whitelist.push({
sourceName: /(?:res|gre-resources)\/forms\.css$/i, sourceName: /(?:res|gre-resources)\/forms\.css$/i,

Просмотреть файл

@ -32,6 +32,7 @@
#include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_dom.h" #include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_fission.h" #include "mozilla/StaticPrefs_fission.h"
#include "mozilla/StaticPrefs_full_screen_api.h"
#include "mozilla/StaticPrefs_layout.h" #include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_network.h" #include "mozilla/StaticPrefs_network.h"
#include "mozilla/StaticPrefs_page_load.h" #include "mozilla/StaticPrefs_page_load.h"
@ -13224,6 +13225,14 @@ void Document::RemoteFrameFullscreenReverted() {
RestorePreviousFullscreenState(std::move(exit)); RestorePreviousFullscreenState(std::move(exit));
} }
/* static */
bool Document::IsUnprefixedFullscreenEnabled(JSContext* aCx,
JSObject* aObject) {
MOZ_ASSERT(NS_IsMainThread());
return nsContentUtils::IsSystemCaller(aCx) ||
StaticPrefs::full_screen_api_unprefix_enabled();
}
static bool HasFullscreenSubDocument(Document* aDoc) { static bool HasFullscreenSubDocument(Document* aDoc) {
uint32_t count = CountFullscreenSubDocuments(aDoc); uint32_t count = CountFullscreenSubDocuments(aDoc);
NS_ASSERTION(count <= 1, NS_ASSERTION(count <= 1,
@ -13235,12 +13244,17 @@ static bool HasFullscreenSubDocument(Document* aDoc) {
// in the given document. Returns a static string indicates the reason // in the given document. Returns a static string indicates the reason
// why it is not enabled otherwise. // why it is not enabled otherwise.
static const char* GetFullscreenError(Document* aDoc, CallerType aCallerType) { static const char* GetFullscreenError(Document* aDoc, CallerType aCallerType) {
if (aCallerType == CallerType::System) { bool apiEnabled = StaticPrefs::full_screen_api_enabled();
if (apiEnabled && aCallerType == CallerType::System) {
// Chrome code can always use the fullscreen API, provided it's not // Chrome code can always use the fullscreen API, provided it's not
// explicitly disabled. // explicitly disabled.
return nullptr; return nullptr;
} }
if (!apiEnabled) {
return "FullscreenDeniedDisabled";
}
if (!aDoc->IsVisible()) { if (!aDoc->IsVisible()) {
return "FullscreenDeniedHidden"; return "FullscreenDeniedHidden";
} }

Просмотреть файл

@ -3659,6 +3659,7 @@ class Document : public nsINode,
mozilla::dom::HTMLAllCollection* All(); mozilla::dom::HTMLAllCollection* All();
static bool IsUnprefixedFullscreenEnabled(JSContext* aCx, JSObject* aObject);
static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject); static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject); static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(CallerType aCallerType); static bool IsWebAnimationsEnabled(CallerType aCallerType);

Просмотреть файл

@ -20,9 +20,13 @@
self[msg.fn].apply(null, msg.args); self[msg.fn].apply(null, msg.args);
} }
function onLoad() { function onLoad() {
// The test file must be loaded into youtube.com domain SpecialPowers.pushPrefEnv({
// because it needs unprivileged access to fullscreenEnabled. "set": [["full-screen-api.unprefix.enabled", true]]
ifr.src = "https://mochitest.youtube.com" + path; }, function() {
// The test file must be loaded into youtube.com domain
// because it needs unprivileged access to fullscreenEnabled.
ifr.src = "https://mochitest.youtube.com" + path;
});
} }
</script> </script>
</head> </head>

Просмотреть файл

@ -19,6 +19,7 @@
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_full_screen_api.h"
#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/EventCallbackDebuggerNotification.h" #include "mozilla/dom/EventCallbackDebuggerNotification.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
@ -646,6 +647,16 @@ bool EventListenerManager::ListenerCanHandle(const Listener* aListener,
if (aEvent->mMessage == eUnidentifiedEvent) { if (aEvent->mMessage == eUnidentifiedEvent) {
return aListener->mTypeAtom == aEvent->mSpecifiedEventType; return aListener->mTypeAtom == aEvent->mSpecifiedEventType;
} }
if (MOZ_UNLIKELY(!StaticPrefs::full_screen_api_unprefix_enabled() &&
aEvent->IsTrusted() &&
(aEventMessage == eFullscreenChange ||
aEventMessage == eFullscreenError))) {
// If unprefixed Fullscreen API is not enabled, don't dispatch it
// to the content.
if (!aEvent->mFlags.mInSystemGroup && !aListener->mIsChrome) {
return false;
}
}
MOZ_ASSERT(mIsMainThreadELM); MOZ_ASSERT(mIsMainThreadELM);
return aListener->mEventMessage == aEventMessage; return aListener->mEventMessage == aEventMessage;
} }

Просмотреть файл

@ -45,6 +45,7 @@ function startTest() {
SimpleTest.waitForFocus(() => { SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["dom.w3c_pointer_events.enabled", true] ["dom.w3c_pointer_events.enabled", true]
] ]

Просмотреть файл

@ -80,6 +80,7 @@ async function runTest() {
add_task(async function() { add_task(async function() {
await pushPrefs( await pushPrefs(
["full-screen-api.unprefix.enabled", true],
["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.enter", "0 0"],
["full-screen-api.transition-duration.leave", "0 0"] ["full-screen-api.transition-duration.leave", "0 0"]
); );
@ -88,6 +89,7 @@ add_task(async function() {
add_task(async function() { add_task(async function() {
await pushPrefs( await pushPrefs(
["full-screen-api.unprefix.enabled", true],
["full-screen-api.transition-duration.enter", "200 200"], ["full-screen-api.transition-duration.enter", "200 200"],
["full-screen-api.transition-duration.leave", "200 200"] ["full-screen-api.transition-duration.leave", "200 200"]
); );

Просмотреть файл

@ -0,0 +1,106 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test for Bug 1268749</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
#fullscreen {
color: green;
}
#fullscreen:fullscreen {
color: red;
}
</style>
</head>
<body>
<div id="fullscreen"></div>
<script>
function ok(condition, msg) {
opener.opener.ok(condition, "[unprefix-disabled] " + msg);
}
function is(a, b, msg) {
opener.opener.is(a, b, "[unprefix-disabled] " + msg);
}
function info(msg) {
opener.opener.info("[unprefix-disabled] " + msg);
}
SimpleTest.requestFlakyTimeout(
"need to wait for a while to confirm no unexpected event is dispatched");
let div = document.getElementById("fullscreen");
let unattachedDiv = document.createElement('div');
function begin() {
ok(!("requestFullscreen" in div), "No element.requestFullscreen");
ok(!("exitFullscreen" in document), "No document.exitFullscreen");
ok(!("fullscreen" in document), "No document.fullscreen");
ok(!("fullscreenElement" in document), "No document.fullscreenElement");
ok(!("fullscreenEnabled" in document), "No document.fullscreenEnabled");
ok(!("onfullscreenchange" in document), "No document.onfullscreenchange");
ok(!("onfullscreenerror" in document), "No document.onfullscreenerror");
for (var event of ["fullscreenchange", "fullscreenerror"]) {
let customEvent = new Event(event, {bubbles: true});
let gotCustomEventFromWindow = false;
let gotCustomEventFromDocument = false;
let listenerForWindow = evt => {
ok(!gotCustomEventFromWindow,
"Should get custom event from window only once");
ok(evt == customEvent, "Should get the desired custom event");
gotCustomEventFromWindow = true;
};
let listenerForDocument = evt => {
ok(!gotCustomEventFromDocument,
"Should get custom event from document only once");
ok(evt == customEvent, "Should get the desired custom event");
gotCustomEventFromDocument = true;
};
window.addEventListener(event, listenerForWindow);
document.addEventListener(event, listenerForDocument);
document.dispatchEvent(customEvent);
ok(gotCustomEventFromWindow, "Should get the custom event from window");
ok(gotCustomEventFromDocument, "Should get the custom event from document");
window.removeEventListener(event, listenerForWindow);
document.removeEventListener(event, listenerForDocument);
for (var target of [window, document]) {
target.addEventListener(event, () => {
ok(false, `No ${event} should be triggered on ${target}`);
});
}
}
document.addEventListener("mozfullscreenchange", enteredFullscreen);
SimpleTest.executeSoon(() => div.mozRequestFullScreen());
}
function enteredFullscreen() {
document.removeEventListener("mozfullscreenchange", enteredFullscreen);
is(getComputedStyle(div).color, "rgb(0, 128, 0)",
":fullscreen should not apply");
document.addEventListener("mozfullscreenchange", exitedFullscreen);
SimpleTest.executeSoon(() => document.mozCancelFullScreen());
}
function exitedFullscreen() {
document.removeEventListener("mozfullscreenchange", exitedFullscreen);
document.addEventListener("mozfullscreenerror", errorFullscreen);
SimpleTest.executeSoon(() => unattachedDiv.mozRequestFullScreen());
}
function errorFullscreen() {
document.removeEventListener("mozfullscreenerror", errorFullscreen);
// Wait a short time before exiting this test to confirm that there is
// really no unwanted event gets dispatched.
setTimeout(() => opener.finish(), 200);
}
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test for Bug 1268749</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="file_fullscreen-utils.js"></script>
</head>
<body>
<script>
var gWindow = null;
function begin() {
SpecialPowers.pushPrefEnv({
"set": [["full-screen-api.unprefix.enabled", false]]
}, () => {
gWindow = window.open("file_fullscreen-unprefix-disabled-inner.html",
"", "width=500,height=500");
waitForLoadAndPaint(gWindow, () => {
gWindow.focus();
SimpleTest.waitForFocus(() => gWindow.begin(), gWindow);
});
});
}
function finish() {
gWindow.close();
SpecialPowers.popPrefEnv(opener.nextTest);
}
</script>
</body>
</html>

Просмотреть файл

@ -467,6 +467,8 @@ support-files =
file_fullscreen-svg-element.html file_fullscreen-svg-element.html
file_fullscreen-table.html file_fullscreen-table.html
file_fullscreen-top-layer.html file_fullscreen-top-layer.html
file_fullscreen-unprefix-disabled-inner.html
file_fullscreen-unprefix-disabled.html
file_fullscreen-utils.js file_fullscreen-utils.js
[test_fullscreen-api-race.html] [test_fullscreen-api-race.html]
tags = fullscreen tags = fullscreen

Просмотреть файл

@ -34,6 +34,7 @@ SimpleTest.requestFlakyTimeout(
addLoadEvent(function () { addLoadEvent(function () {
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
// Use legacy data: URI behavior to run test. // Use legacy data: URI behavior to run test.
["security.data_uri.unique_opaque_origin", false], ["security.data_uri.unique_opaque_origin", false],

Просмотреть файл

@ -44,6 +44,7 @@ var gTestWindows = [
{ test: "file_fullscreen-backdrop.html" }, { test: "file_fullscreen-backdrop.html" },
{ test: "file_fullscreen-nested.html" }, { test: "file_fullscreen-nested.html" },
{ test: "file_fullscreen-prefixed.html" }, { test: "file_fullscreen-prefixed.html" },
{ test: "file_fullscreen-unprefix-disabled.html" },
{ test: "file_fullscreen-lenient-setters.html" }, { test: "file_fullscreen-lenient-setters.html" },
{ test: "file_fullscreen-table.html" }, { test: "file_fullscreen-table.html" },
{ test: "file_fullscreen-event-order.html" }, { test: "file_fullscreen-event-order.html" },
@ -172,6 +173,7 @@ addLoadEvent(function() {
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.enabled", true], ["full-screen-api.enabled", true],
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.enter", "0 0"],
["full-screen-api.transition-duration.leave", "0 0"] ["full-screen-api.transition-duration.leave", "0 0"]

Просмотреть файл

@ -69,6 +69,7 @@
runTest(async function () { runTest(async function () {
await pushPrefs( await pushPrefs(
["full-screen-api.enabled", true], ["full-screen-api.enabled", true],
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.enter", "0 0"],
["full-screen-api.transition-duration.leave", "0 0"], ["full-screen-api.transition-duration.leave", "0 0"],

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -48,6 +48,7 @@
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
"set": [ "set": [
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.unprefix.enabled", true],
], ],
}); });
}); });

Просмотреть файл

@ -30,6 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602
SpecialPowers.pushPrefEnv({"set": [ SpecialPowers.pushPrefEnv({"set": [
["full-screen-api.enabled", true], ["full-screen-api.enabled", true],
["full-screen-api.unprefix.enabled", true],
["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.allow-trusted-requests-only", false],
["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.enter", "0 0"],
["full-screen-api.transition-duration.leave", "0 0"] ["full-screen-api.transition-duration.leave", "0 0"]

Просмотреть файл

@ -288,22 +288,24 @@ partial interface Document {
partial interface Document { partial interface Document {
// Note: Per spec the 'S' in these two is lowercase, but the "Moz" // Note: Per spec the 'S' in these two is lowercase, but the "Moz"
// versions have it uppercase. // versions have it uppercase.
[LenientSetter, Unscopable] [LenientSetter, Unscopable, Func="Document::IsUnprefixedFullscreenEnabled"]
readonly attribute boolean fullscreen; readonly attribute boolean fullscreen;
[BinaryName="fullscreen"] [BinaryName="fullscreen"]
readonly attribute boolean mozFullScreen; readonly attribute boolean mozFullScreen;
[LenientSetter, NeedsCallerType] [LenientSetter, Func="Document::IsUnprefixedFullscreenEnabled", NeedsCallerType]
readonly attribute boolean fullscreenEnabled; readonly attribute boolean fullscreenEnabled;
[BinaryName="fullscreenEnabled", NeedsCallerType] [BinaryName="fullscreenEnabled", NeedsCallerType]
readonly attribute boolean mozFullScreenEnabled; readonly attribute boolean mozFullScreenEnabled;
[Throws] [Throws, Func="Document::IsUnprefixedFullscreenEnabled"]
Promise<void> exitFullscreen(); Promise<void> exitFullscreen();
[Throws, BinaryName="exitFullscreen"] [Throws, BinaryName="exitFullscreen"]
Promise<void> mozCancelFullScreen(); Promise<void> mozCancelFullScreen();
// Events handlers // Events handlers
[Func="Document::IsUnprefixedFullscreenEnabled"]
attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenchange;
[Func="Document::IsUnprefixedFullscreenEnabled"]
attribute EventHandler onfullscreenerror; attribute EventHandler onfullscreenerror;
}; };

Просмотреть файл

@ -28,7 +28,7 @@ interface mixin DocumentOrShadowRoot {
readonly attribute StyleSheetList styleSheets; readonly attribute StyleSheetList styleSheets;
readonly attribute Element? pointerLockElement; readonly attribute Element? pointerLockElement;
[LenientSetter] [LenientSetter, Func="Document::IsUnprefixedFullscreenEnabled"]
readonly attribute Element? fullscreenElement; readonly attribute Element? fullscreenElement;
[BinaryName="fullscreenElement"] [BinaryName="fullscreenElement"]
readonly attribute Element? mozFullScreenElement; readonly attribute Element? mozFullScreenElement;

Просмотреть файл

@ -282,13 +282,15 @@ Element includes GeometryUtils;
// https://fullscreen.spec.whatwg.org/#api // https://fullscreen.spec.whatwg.org/#api
partial interface Element { partial interface Element {
[Throws, NeedsCallerType] [Throws, Func="Document::IsUnprefixedFullscreenEnabled", NeedsCallerType]
Promise<void> requestFullscreen(); Promise<void> requestFullscreen();
[Throws, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"] [Throws, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"]
Promise<void> mozRequestFullScreen(); Promise<void> mozRequestFullScreen();
// Events handlers // Events handlers
[Func="Document::IsUnprefixedFullscreenEnabled"]
attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenchange;
[Func="Document::IsUnprefixedFullscreenEnabled"]
attribute EventHandler onfullscreenerror; attribute EventHandler onfullscreenerror;
}; };

Просмотреть файл

@ -3068,6 +3068,12 @@
value: false value: false
mirror: always mirror: always
- name: full-screen-api.unprefix.enabled
type: RelaxedAtomicBool
value: true
mirror: always
rust: true
- name: full-screen-api.allow-trusted-requests-only - name: full-screen-api.allow-trusted-requests-only
type: bool type: bool
value: true value: true

Просмотреть файл

@ -48,7 +48,8 @@ macro_rules! apply_non_ts_list {
("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), ("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _),
("-moz-devtools-highlighted", MozDevtoolsHighlighted, mozDevtoolsHighlighted, IN_DEVTOOLS_HIGHLIGHTED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-devtools-highlighted", MozDevtoolsHighlighted, mozDevtoolsHighlighted, IN_DEVTOOLS_HIGHLIGHTED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, mozStyleeditorTransitioning, IN_STYLEEDITOR_TRANSITIONING_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS), ("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, mozStyleeditorTransitioning, IN_STYLEEDITOR_TRANSITIONING_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("fullscreen", Fullscreen, fullscreen, IN_FULLSCREEN_STATE, _), ("fullscreen", Fullscreen, fullscreen, IN_FULLSCREEN_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-full-screen", MozFullScreen, mozFullScreen, IN_FULLSCREEN_STATE, _),
// TODO(emilio): This is inconsistently named (the capital R). // TODO(emilio): This is inconsistently named (the capital R).
("-moz-focusring", MozFocusRing, mozFocusRing, IN_FOCUSRING_STATE, _), ("-moz-focusring", MozFocusRing, mozFocusRing, IN_FOCUSRING_STATE, _),
("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _), ("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _),

Просмотреть файл

@ -137,7 +137,6 @@ impl NonTSPseudoClass {
([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => { ([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => {
match_ignore_ascii_case! { &name, match_ignore_ascii_case! { &name,
$($css => Some(NonTSPseudoClass::$name),)* $($css => Some(NonTSPseudoClass::$name),)*
"-moz-full-screen" => Some(NonTSPseudoClass::Fullscreen),
_ => None, _ => None,
} }
} }
@ -170,9 +169,16 @@ impl NonTSPseudoClass {
} }
/// Returns whether the pseudo-class is enabled in content sheets. /// Returns whether the pseudo-class is enabled in content sheets.
#[inline]
fn is_enabled_in_content(&self) -> bool { fn is_enabled_in_content(&self) -> bool {
!self.has_any_flag(NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME) match *self {
// For pseudo-classes with pref, the availability in content
// depends on the pref.
NonTSPseudoClass::Fullscreen => static_prefs::pref!("full-screen-api.unprefix.enabled"),
// Otherwise, a pseudo-class is enabled in content when it
// doesn't have any enabled flag.
_ => !self
.has_any_flag(NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
}
} }
/// Get the state flag associated with a pseudo-class, if any. /// Get the state flag associated with a pseudo-class, if any.

Просмотреть файл

@ -2045,6 +2045,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
NonTSPseudoClass::Disabled | NonTSPseudoClass::Disabled |
NonTSPseudoClass::Checked | NonTSPseudoClass::Checked |
NonTSPseudoClass::Fullscreen | NonTSPseudoClass::Fullscreen |
NonTSPseudoClass::MozFullScreen |
NonTSPseudoClass::Indeterminate | NonTSPseudoClass::Indeterminate |
NonTSPseudoClass::PlaceholderShown | NonTSPseudoClass::PlaceholderShown |
NonTSPseudoClass::Target | NonTSPseudoClass::Target |

Просмотреть файл

@ -0,0 +1 @@
prefs: [full-screen-api.unprefix.enabled:true]

Просмотреть файл

@ -1,4 +1,5 @@
[iframe-allowfullscreen.html] [iframe-allowfullscreen.html]
prefs: [full-screen-api.unprefix.enabled:true]
[iframe-same-origin-allowfullscreen] [iframe-same-origin-allowfullscreen]
expected: FAIL expected: FAIL