From 2b5af87228c9d4544c759c62d7464f72954d10ab Mon Sep 17 00:00:00 2001 From: Noemi Erli Date: Thu, 12 Dec 2019 23:49:35 +0200 Subject: [PATCH] Backed out changeset d23f209ada8b (bug 1603455) for causing failures in test_fullscreen-api.html --HG-- extra : rebase_source : 7b7990746d3884eeced2404ed9bc78590db4b77c --- .../test/static/browser_parsable_css.js | 16 +++ dom/base/Document.cpp | 16 ++- dom/base/Document.h | 1 + dom/base/test/test_youtube_flash_embed.html | 10 +- dom/events/EventListenerManager.cpp | 11 ++ ..._trigger_fullscreen_by_pointer_events.html | 1 + dom/html/test/browser_fullscreen-newtab.js | 2 + ...le_fullscreen-unprefix-disabled-inner.html | 106 ++++++++++++++++++ .../file_fullscreen-unprefix-disabled.html | 35 ++++++ dom/html/test/mochitest.ini | 2 + dom/html/test/test_fullscreen-api-race.html | 1 + dom/html/test/test_fullscreen-api.html | 2 + .../test_getUserMedia_basicScreenshare.html | 1 + .../test/mochitest/test_bug1028200-1.html | 1 + .../test/mochitest/test_bug1028200-2.html | 1 + .../test/mochitest/test_bug1028200-3.html | 1 + .../test/mochitest/test_bug1028200-4.html | 1 + .../test/mochitest/test_bug1028200-5.html | 1 + .../test/mochitest/test_bug1028200-6.html | 1 + .../test/mochitest/test_bug1028200-7.html | 1 + .../pointerlock/test_pointerlock-api.html | 1 + dom/webidl/Document.webidl | 8 +- dom/webidl/DocumentOrShadowRoot.webidl | 2 +- dom/webidl/Element.webidl | 4 +- modules/libpref/init/StaticPrefList.yaml | 6 + .../style/gecko/non_ts_pseudo_class_list.rs | 3 +- .../components/style/gecko/selector_parser.rs | 12 +- servo/components/style/gecko/wrapper.rs | 1 + .../web-platform/meta/fullscreen/__dir__.ini | 1 + .../iframe-allowfullscreen.html.ini | 1 + 30 files changed, 237 insertions(+), 13 deletions(-) create mode 100644 dom/html/test/file_fullscreen-unprefix-disabled-inner.html create mode 100644 dom/html/test/file_fullscreen-unprefix-disabled.html create mode 100644 testing/web-platform/meta/fullscreen/__dir__.ini diff --git a/browser/base/content/test/static/browser_parsable_css.js b/browser/base/content/test/static/browser_parsable_css.js index 635ee0d553a1..146b07360fbd 100644 --- a/browser/base/content/test/static/browser_parsable_css.js +++ b/browser/base/content/test/static/browser_parsable_css.js @@ -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")) { whitelist.push({ sourceName: /(?:res|gre-resources)\/forms\.css$/i, diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index b862a64b1ed7..e18b37f29515 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -32,6 +32,7 @@ #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_dom.h" #include "mozilla/StaticPrefs_fission.h" +#include "mozilla/StaticPrefs_full_screen_api.h" #include "mozilla/StaticPrefs_layout.h" #include "mozilla/StaticPrefs_network.h" #include "mozilla/StaticPrefs_page_load.h" @@ -13224,6 +13225,14 @@ void Document::RemoteFrameFullscreenReverted() { 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) { uint32_t count = CountFullscreenSubDocuments(aDoc); NS_ASSERTION(count <= 1, @@ -13235,12 +13244,17 @@ static bool HasFullscreenSubDocument(Document* aDoc) { // in the given document. Returns a static string indicates the reason // why it is not enabled otherwise. 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 // explicitly disabled. return nullptr; } + if (!apiEnabled) { + return "FullscreenDeniedDisabled"; + } + if (!aDoc->IsVisible()) { return "FullscreenDeniedHidden"; } diff --git a/dom/base/Document.h b/dom/base/Document.h index 95fa7fc91fc5..6a03fe0a0c3b 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -3659,6 +3659,7 @@ class Document : public nsINode, mozilla::dom::HTMLAllCollection* All(); + static bool IsUnprefixedFullscreenEnabled(JSContext* aCx, JSObject* aObject); static bool DocumentSupportsL10n(JSContext* aCx, JSObject* aObject); static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject); static bool IsWebAnimationsEnabled(CallerType aCallerType); diff --git a/dom/base/test/test_youtube_flash_embed.html b/dom/base/test/test_youtube_flash_embed.html index 2c7cddaefd7d..36ef07bb3e65 100644 --- a/dom/base/test/test_youtube_flash_embed.html +++ b/dom/base/test/test_youtube_flash_embed.html @@ -20,9 +20,13 @@ self[msg.fn].apply(null, msg.args); } function onLoad() { - // The test file must be loaded into youtube.com domain - // because it needs unprivileged access to fullscreenEnabled. - ifr.src = "https://mochitest.youtube.com" + path; + SpecialPowers.pushPrefEnv({ + "set": [["full-screen-api.unprefix.enabled", true]] + }, 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; + }); } diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index 84bc35668b19..9b2f6bd666d6 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -19,6 +19,7 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/Preferences.h" #include "mozilla/PresShell.h" +#include "mozilla/StaticPrefs_full_screen_api.h" #include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/EventCallbackDebuggerNotification.h" #include "mozilla/dom/Element.h" @@ -646,6 +647,16 @@ bool EventListenerManager::ListenerCanHandle(const Listener* aListener, if (aEvent->mMessage == eUnidentifiedEvent) { 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); return aListener->mEventMessage == aEventMessage; } diff --git a/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html index 3484e87f7321..56e772c4fa6c 100644 --- a/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html +++ b/dom/events/test/pointerevents/test_trigger_fullscreen_by_pointer_events.html @@ -45,6 +45,7 @@ function startTest() { SimpleTest.waitForFocus(() => { SpecialPowers.pushPrefEnv({ "set": [ + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.allow-trusted-requests-only", false], ["dom.w3c_pointer_events.enabled", true] ] diff --git a/dom/html/test/browser_fullscreen-newtab.js b/dom/html/test/browser_fullscreen-newtab.js index 0b519fd8d57e..c678285434c9 100644 --- a/dom/html/test/browser_fullscreen-newtab.js +++ b/dom/html/test/browser_fullscreen-newtab.js @@ -80,6 +80,7 @@ async function runTest() { add_task(async function() { await pushPrefs( + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.leave", "0 0"] ); @@ -88,6 +89,7 @@ add_task(async function() { add_task(async function() { await pushPrefs( + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.transition-duration.enter", "200 200"], ["full-screen-api.transition-duration.leave", "200 200"] ); diff --git a/dom/html/test/file_fullscreen-unprefix-disabled-inner.html b/dom/html/test/file_fullscreen-unprefix-disabled-inner.html new file mode 100644 index 000000000000..4991d50045c8 --- /dev/null +++ b/dom/html/test/file_fullscreen-unprefix-disabled-inner.html @@ -0,0 +1,106 @@ + + + + + Test for Bug 1268749 + + + + + +
+ + + diff --git a/dom/html/test/file_fullscreen-unprefix-disabled.html b/dom/html/test/file_fullscreen-unprefix-disabled.html new file mode 100644 index 000000000000..0a645dd4af15 --- /dev/null +++ b/dom/html/test/file_fullscreen-unprefix-disabled.html @@ -0,0 +1,35 @@ + + + + + Test for Bug 1268749 + + + + + + + + diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index b844cf7b20b3..659b706dc3f3 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -467,6 +467,8 @@ support-files = file_fullscreen-svg-element.html file_fullscreen-table.html file_fullscreen-top-layer.html + file_fullscreen-unprefix-disabled-inner.html + file_fullscreen-unprefix-disabled.html file_fullscreen-utils.js [test_fullscreen-api-race.html] tags = fullscreen diff --git a/dom/html/test/test_fullscreen-api-race.html b/dom/html/test/test_fullscreen-api-race.html index 1af00bf2db78..d5928ff7ae78 100644 --- a/dom/html/test/test_fullscreen-api-race.html +++ b/dom/html/test/test_fullscreen-api-race.html @@ -34,6 +34,7 @@ SimpleTest.requestFlakyTimeout( addLoadEvent(function () { SpecialPowers.pushPrefEnv({ "set": [ + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.allow-trusted-requests-only", false], // Use legacy data: URI behavior to run test. ["security.data_uri.unique_opaque_origin", false], diff --git a/dom/html/test/test_fullscreen-api.html b/dom/html/test/test_fullscreen-api.html index e10d3992fef3..264cd07938ae 100644 --- a/dom/html/test/test_fullscreen-api.html +++ b/dom/html/test/test_fullscreen-api.html @@ -44,6 +44,7 @@ var gTestWindows = [ { test: "file_fullscreen-backdrop.html" }, { test: "file_fullscreen-nested.html" }, { test: "file_fullscreen-prefixed.html" }, + { test: "file_fullscreen-unprefix-disabled.html" }, { test: "file_fullscreen-lenient-setters.html" }, { test: "file_fullscreen-table.html" }, { test: "file_fullscreen-event-order.html" }, @@ -172,6 +173,7 @@ addLoadEvent(function() { SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.enabled", true], + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.leave", "0 0"] diff --git a/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html b/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html index 00ffc74f88ae..480ed286234c 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html +++ b/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html @@ -69,6 +69,7 @@ runTest(async function () { await pushPrefs( ["full-screen-api.enabled", true], + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.leave", "0 0"], diff --git a/dom/plugins/test/mochitest/test_bug1028200-1.html b/dom/plugins/test/mochitest/test_bug1028200-1.html index 5a47627e7986..9e064d8cab95 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-1.html +++ b/dom/plugins/test/mochitest/test_bug1028200-1.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-2.html b/dom/plugins/test/mochitest/test_bug1028200-2.html index 02e89ed42562..8d54d52d4e5e 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-2.html +++ b/dom/plugins/test/mochitest/test_bug1028200-2.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-3.html b/dom/plugins/test/mochitest/test_bug1028200-3.html index 1563e8b048d4..57756b0b6795 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-3.html +++ b/dom/plugins/test/mochitest/test_bug1028200-3.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-4.html b/dom/plugins/test/mochitest/test_bug1028200-4.html index 579594cd2246..3547186b0d7e 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-4.html +++ b/dom/plugins/test/mochitest/test_bug1028200-4.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-5.html b/dom/plugins/test/mochitest/test_bug1028200-5.html index 9230c1f6eb6f..65e6cda911df 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-5.html +++ b/dom/plugins/test/mochitest/test_bug1028200-5.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-6.html b/dom/plugins/test/mochitest/test_bug1028200-6.html index 7046482a81c7..d4424b7f1f48 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-6.html +++ b/dom/plugins/test/mochitest/test_bug1028200-6.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/plugins/test/mochitest/test_bug1028200-7.html b/dom/plugins/test/mochitest/test_bug1028200-7.html index 0d7e4711f23a..c67b4d77e6ce 100644 --- a/dom/plugins/test/mochitest/test_bug1028200-7.html +++ b/dom/plugins/test/mochitest/test_bug1028200-7.html @@ -48,6 +48,7 @@ await SpecialPowers.pushPrefEnv({ "set": [ ["full-screen-api.allow-trusted-requests-only", false], + ["full-screen-api.unprefix.enabled", true], ], }); }); diff --git a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html index 954febcce8d5..189ee1dae92c 100644 --- a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html +++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html @@ -30,6 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=633602 SpecialPowers.pushPrefEnv({"set": [ ["full-screen-api.enabled", true], + ["full-screen-api.unprefix.enabled", true], ["full-screen-api.allow-trusted-requests-only", false], ["full-screen-api.transition-duration.enter", "0 0"], ["full-screen-api.transition-duration.leave", "0 0"] diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl index 3f5c24cedacd..97735dc60f61 100644 --- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -288,22 +288,24 @@ partial interface Document { partial interface Document { // Note: Per spec the 'S' in these two is lowercase, but the "Moz" // versions have it uppercase. - [LenientSetter, Unscopable] + [LenientSetter, Unscopable, Func="Document::IsUnprefixedFullscreenEnabled"] readonly attribute boolean fullscreen; [BinaryName="fullscreen"] readonly attribute boolean mozFullScreen; - [LenientSetter, NeedsCallerType] + [LenientSetter, Func="Document::IsUnprefixedFullscreenEnabled", NeedsCallerType] readonly attribute boolean fullscreenEnabled; [BinaryName="fullscreenEnabled", NeedsCallerType] readonly attribute boolean mozFullScreenEnabled; - [Throws] + [Throws, Func="Document::IsUnprefixedFullscreenEnabled"] Promise exitFullscreen(); [Throws, BinaryName="exitFullscreen"] Promise mozCancelFullScreen(); // Events handlers + [Func="Document::IsUnprefixedFullscreenEnabled"] attribute EventHandler onfullscreenchange; + [Func="Document::IsUnprefixedFullscreenEnabled"] attribute EventHandler onfullscreenerror; }; diff --git a/dom/webidl/DocumentOrShadowRoot.webidl b/dom/webidl/DocumentOrShadowRoot.webidl index fdcd32aa3e85..9dfd0673d9ce 100644 --- a/dom/webidl/DocumentOrShadowRoot.webidl +++ b/dom/webidl/DocumentOrShadowRoot.webidl @@ -28,7 +28,7 @@ interface mixin DocumentOrShadowRoot { readonly attribute StyleSheetList styleSheets; readonly attribute Element? pointerLockElement; - [LenientSetter] + [LenientSetter, Func="Document::IsUnprefixedFullscreenEnabled"] readonly attribute Element? fullscreenElement; [BinaryName="fullscreenElement"] readonly attribute Element? mozFullScreenElement; diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl index 1f0ff28052db..beaf9155caa2 100644 --- a/dom/webidl/Element.webidl +++ b/dom/webidl/Element.webidl @@ -282,13 +282,15 @@ Element includes GeometryUtils; // https://fullscreen.spec.whatwg.org/#api partial interface Element { - [Throws, NeedsCallerType] + [Throws, Func="Document::IsUnprefixedFullscreenEnabled", NeedsCallerType] Promise requestFullscreen(); [Throws, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"] Promise mozRequestFullScreen(); // Events handlers + [Func="Document::IsUnprefixedFullscreenEnabled"] attribute EventHandler onfullscreenchange; + [Func="Document::IsUnprefixedFullscreenEnabled"] attribute EventHandler onfullscreenerror; }; diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 77997f4613e7..ece457c47864 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3068,6 +3068,12 @@ value: false mirror: always +- name: full-screen-api.unprefix.enabled + type: RelaxedAtomicBool + value: true + mirror: always + rust: true + - name: full-screen-api.allow-trusted-requests-only type: bool value: true diff --git a/servo/components/style/gecko/non_ts_pseudo_class_list.rs b/servo/components/style/gecko/non_ts_pseudo_class_list.rs index 8d9fc3d2d851..eca60fdc586d 100644 --- a/servo/components/style/gecko/non_ts_pseudo_class_list.rs +++ b/servo/components/style/gecko/non_ts_pseudo_class_list.rs @@ -48,7 +48,8 @@ macro_rules! apply_non_ts_list { ("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), ("-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), - ("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). ("-moz-focusring", MozFocusRing, mozFocusRing, IN_FOCUSRING_STATE, _), ("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _), diff --git a/servo/components/style/gecko/selector_parser.rs b/servo/components/style/gecko/selector_parser.rs index 9f5b49c5c138..d27e954d8a8c 100644 --- a/servo/components/style/gecko/selector_parser.rs +++ b/servo/components/style/gecko/selector_parser.rs @@ -137,7 +137,6 @@ impl NonTSPseudoClass { ([$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*]) => { match_ignore_ascii_case! { &name, $($css => Some(NonTSPseudoClass::$name),)* - "-moz-full-screen" => Some(NonTSPseudoClass::Fullscreen), _ => None, } } @@ -170,9 +169,16 @@ impl NonTSPseudoClass { } /// Returns whether the pseudo-class is enabled in content sheets. - #[inline] 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. diff --git a/servo/components/style/gecko/wrapper.rs b/servo/components/style/gecko/wrapper.rs index 21fffb975c79..e00799210720 100644 --- a/servo/components/style/gecko/wrapper.rs +++ b/servo/components/style/gecko/wrapper.rs @@ -2045,6 +2045,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { NonTSPseudoClass::Disabled | NonTSPseudoClass::Checked | NonTSPseudoClass::Fullscreen | + NonTSPseudoClass::MozFullScreen | NonTSPseudoClass::Indeterminate | NonTSPseudoClass::PlaceholderShown | NonTSPseudoClass::Target | diff --git a/testing/web-platform/meta/fullscreen/__dir__.ini b/testing/web-platform/meta/fullscreen/__dir__.ini new file mode 100644 index 000000000000..d9e292757199 --- /dev/null +++ b/testing/web-platform/meta/fullscreen/__dir__.ini @@ -0,0 +1 @@ +prefs: [full-screen-api.unprefix.enabled:true] diff --git a/testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html.ini b/testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html.ini index 9be009e9b0eb..5f414b3492c7 100644 --- a/testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html.ini +++ b/testing/web-platform/meta/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html.ini @@ -1,4 +1,5 @@ [iframe-allowfullscreen.html] + prefs: [full-screen-api.unprefix.enabled:true] [iframe-same-origin-allowfullscreen] expected: FAIL