Skip to content

Commit

Permalink
Remove UnprefixedFullscreenAPIEnabled preference
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271142

Reviewed by Tim Nguyen.

It's been stable for over a year.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/dom/Document+Fullscreen.idl:
* Source/WebCore/dom/DocumentOrShadowRoot+Fullscreen.idl:
* Source/WebCore/dom/Element+Fullscreen.idl:
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::dispatchEventForNode):

Canonical link: https://commits.webkit.org/276301@main
  • Loading branch information
annevk committed Mar 18, 2024
1 parent 737de53 commit bf10e09
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 29 deletions.
14 changes: 0 additions & 14 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6783,20 +6783,6 @@ UnifiedPDFEnabled:
"ENABLE(UNIFIED_PDF_BY_DEFAULT)": true
default: false

UnprefixedFullscreenAPIEnabled:
type: bool
status: stable
category: dom
humanReadableName: "Unprefixed Fullscreen API"
humanReadableDescription: "Enable Unprefixed Fullscreen API"
defaultValue:
WebKitLegacy:
default: true
WebKit:
default: true
WebCore:
default: true

UpgradeKnownHostsToHTTPSEnabled:
type: bool
status: internal
Expand Down
10 changes: 5 additions & 5 deletions Source/WebCore/dom/Document+Fullscreen.idl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
DisabledByQuirk=shouldDisableElementFullscreen,
ImplementedBy=DocumentFullscreen
] partial interface Document {
[LegacyLenientSetter, EnabledBySetting=UnprefixedFullscreenAPIEnabled, ImplementedAs=fullscreenEnabled] readonly attribute boolean fullscreenEnabled;
[LegacyLenientSetter, Unscopable, EnabledBySetting=UnprefixedFullscreenAPIEnabled, ImplementedAs=webkitIsFullScreen] readonly attribute boolean fullscreen; // historical
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] Promise<undefined> exitFullscreen();
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] attribute EventHandler onfullscreenchange;
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] attribute EventHandler onfullscreenerror;
[LegacyLenientSetter] readonly attribute boolean fullscreenEnabled;
[LegacyLenientSetter, Unscopable, ImplementedAs=webkitIsFullScreen] readonly attribute boolean fullscreen; // historical
Promise<undefined> exitFullscreen();
attribute EventHandler onfullscreenchange;
attribute EventHandler onfullscreenerror;

// Legacy WebKit-specific versions.
readonly attribute boolean webkitFullscreenEnabled;
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/dom/DocumentOrShadowRoot+Fullscreen.idl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// https://fullscreen.spec.whatwg.org/#api
[
Conditional=FULLSCREEN_API,
EnabledBySetting=UnprefixedFullscreenAPIEnabled,
DisabledByQuirk=shouldDisableElementFullscreen,
ImplementedBy=DocumentOrShadowRootFullscreen
] partial interface mixin DocumentOrShadowRoot {
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/dom/Element+Fullscreen.idl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
EnabledBySetting=FullScreenEnabled,
DisabledByQuirk=shouldDisableElementFullscreen
] partial interface Element {
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] Promise<undefined> requestFullscreen(optional FullscreenOptions options = {});
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] attribute EventHandler onfullscreenchange;
[EnabledBySetting=UnprefixedFullscreenAPIEnabled] attribute EventHandler onfullscreenerror;
Promise<undefined> requestFullscreen(optional FullscreenOptions options = {});
attribute EventHandler onfullscreenchange;
attribute EventHandler onfullscreenerror;

// Non-standard: WebKit prefixed variants.
[ImplementedAs=webkitRequestFullscreen] undefined webkitRequestFullScreen(); // Prefixed Mozilla version.
Expand Down
9 changes: 3 additions & 6 deletions Source/WebCore/dom/FullscreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,19 +671,16 @@ void FullscreenManager::notifyAboutFullscreenChangeOrError()

void FullscreenManager::dispatchEventForNode(Node& node, EventType eventType)
{
bool supportsUnprefixedAPI = document().settings().unprefixedFullscreenAPIEnabled();
switch (eventType) {
case EventType::Change: {
if (supportsUnprefixedAPI)
node.dispatchEvent(Event::create(eventNames().fullscreenchangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
node.dispatchEvent(Event::create(eventNames().fullscreenchangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
bool shouldEmitUnprefixed = !(node.hasEventListeners(eventNames().webkitfullscreenchangeEvent) && node.hasEventListeners(eventNames().fullscreenchangeEvent)) && !(node.document().hasEventListeners(eventNames().webkitfullscreenchangeEvent) && node.document().hasEventListeners(eventNames().fullscreenchangeEvent));
if (!supportsUnprefixedAPI || shouldEmitUnprefixed)
if (shouldEmitUnprefixed)
node.dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
break;
}
case EventType::Error:
if (supportsUnprefixedAPI)
node.dispatchEvent(Event::create(eventNames().fullscreenerrorEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
node.dispatchEvent(Event::create(eventNames().fullscreenerrorEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
node.dispatchEvent(Event::create(eventNames().webkitfullscreenerrorEvent, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
break;
}
Expand Down

0 comments on commit bf10e09

Please sign in to comment.