Make Fullscreen API an Experimental Feature
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 20:06:58 +0000 (20:06 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2018 20:06:58 +0000 (20:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183662

Reviewed by Jon Lee.

Source/WebCore:

The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
Experimental Feature is disabled.

* dom/Document.idl:
* dom/Element.idl:

Source/WebKit:

Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
whether the preference is available, for definining platform-specific Experimental Features.

* Scripts/GeneratePreferences.rb:
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Shared/WebPreferences.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229680 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.idl
Source/WebKit/ChangeLog
Source/WebKit/Scripts/GeneratePreferences.rb
Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
Source/WebKit/Shared/WebPreferences.yaml

index e5c01dc..8066011 100644 (file)
@@ -1,3 +1,16 @@
+2018-03-16  Jer Noble  <jer.noble@apple.com>
+
+        Make Fullscreen API an Experimental Feature
+        https://bugs.webkit.org/show_bug.cgi?id=183662
+
+        Reviewed by Jon Lee.
+
+        The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
+        Experimental Feature is disabled.
+
+        * dom/Document.idl:
+        * dom/Element.idl:
+
 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
 
         Ensure that style is updated when the effective appearance changes
index b4bafb3..8e077df 100644 (file)
@@ -144,15 +144,15 @@ typedef (
 
     // Extensions from FullScreen API (https://fullscreen.spec.whatwg.org/#api).
     // FIXME: Should probably be unprefixed.
-    [Conditional=FULLSCREEN_API] readonly attribute boolean webkitFullscreenEnabled;
-    [Conditional=FULLSCREEN_API, ImplementedAs=webkitFullscreenElementForBindings] readonly attribute Element? webkitFullscreenElement;
-    [Conditional=FULLSCREEN_API] void webkitExitFullscreen();
-    [Conditional=FULLSCREEN_API] readonly attribute boolean webkitIsFullScreen; // Mozilla version.
-    [Conditional=FULLSCREEN_API] readonly attribute boolean webkitFullScreenKeyboardInputAllowed; // Mozilla version.
-    [Conditional=FULLSCREEN_API, ImplementedAs=webkitCurrentFullScreenElementForBindings] readonly attribute Element webkitCurrentFullScreenElement; // Mozilla version.
-    [Conditional=FULLSCREEN_API] void webkitCancelFullScreen(); // Mozilla version.
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenchange;
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenerror;
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] readonly attribute boolean webkitFullscreenEnabled;
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen, ImplementedAs=webkitFullscreenElementForBindings] readonly attribute Element? webkitFullscreenElement;
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] void webkitExitFullscreen();
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] readonly attribute boolean webkitIsFullScreen; // Mozilla version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] readonly attribute boolean webkitFullScreenKeyboardInputAllowed; // Mozilla version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen, ImplementedAs=webkitCurrentFullScreenElementForBindings] readonly attribute Element webkitCurrentFullScreenElement; // Mozilla version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] void webkitCancelFullScreen(); // Mozilla version.
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenchange;
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenerror;
 
     // Extensions from Pointer Lock API (https://www.w3.org/TR/pointerlock/#extensions-to-the-document-interface).
     [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockchange; // FIXME: Should be enumerable.
index 9e83bb4..c2985af 100644 (file)
@@ -94,8 +94,8 @@
 
     // Extensions from Full Screen API (https://fullscreen.spec.whatwg.org/#api).
     // FIXME: Should we add unprefixed versions?
-    [Conditional=FULLSCREEN_API, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen(); // Prefixed Mozilla version.
-    [Conditional=FULLSCREEN_API] void webkitRequestFullscreen(); // Prefixed W3C version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen(); // Prefixed Mozilla version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] void webkitRequestFullscreen(); // Prefixed W3C version.
 
     // Extensions from Pointer Lock API (https://w3c.github.io/pointerlock/#extensions-to-the-element-interface).
     [Conditional=POINTER_LOCK] void requestPointerLock();
     [NotEnumerable, ImplementedAs=onwebkitTransitionEnd] attribute EventHandler onwebkittransitionend;
 
     // FIXME: These event handlers should only be on Document (https://fullscreen.spec.whatwg.org/#api).
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenchange;
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenerror;
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenchange;
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenerror;
 
     // FIXME: Cannot find those EventHandlers in the latest specification (https://w3c.github.io/uievents/#events-focus-types).
     [NotEnumerable] attribute EventHandler onfocusin;
index 17cb56d..59026c0 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-16  Jer Noble  <jer.noble@apple.com>
+
+        Make Fullscreen API an Experimental Feature
+        https://bugs.webkit.org/show_bug.cgi?id=183662
+
+        Reviewed by Jon Lee.
+
+        Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
+        whether the preference is available, for definining platform-specific Experimental Features.
+
+        * Scripts/GeneratePreferences.rb:
+        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
+        * Shared/WebPreferences.yaml:
+
 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
 
         Ensure that style is updated when the effective appearance changes
index 262b85b..141c1f5 100755 (executable)
@@ -70,6 +70,7 @@ class Preference
   attr_accessor :category
   attr_accessor :webcoreBinding
   attr_accessor :condition
+  attr_accessor :visibleCondition
 
   def initialize(name, opts)
     @name = name
@@ -82,6 +83,7 @@ class Preference
     @webcoreBinding = opts["webcoreBinding"]
     @webcoreName = opts["webcoreName"]
     @condition = opts["condition"]
+    @visibleCondition = opts["visibleCondition"]
   end
 
   def nameLower
index ef1b493..9c256d7 100644 (file)
@@ -53,7 +53,13 @@ const Vector<RefPtr<API::Object>>& WebPreferences::experimentalFeatures()
 <%- if @pref.condition -%>
 #if <%= @pref.condition %>
 <%- end -%>
+<%- if @pref.visibleCondition -%>
+#if <%= @pref.visibleCondition %>
+<%- end -%>
         API::ExperimentalFeature::create(<%= @pref.humanReadableName %>, "<%= @pref.name %>", <%= @pref.humanReadableDescription %>, <%= @pref.defaultValue %>),
+<%- if @pref.visibleCondition -%>
+#endif
+<%- end -%>
 <%- if @pref.condition -%>
 #endif
 <%- end -%>
index 6c01b89..11e9c45 100644 (file)
@@ -167,6 +167,10 @@ FullScreenEnabled:
   type: bool
   defaultValue: false
   condition: ENABLE(FULLSCREEN_API)
+  visibleCondition: PLATFORM(IOS)
+  humanReadableName: "Fullscreen API"
+  humanReadableDescription: "Fullscreen API"
+  category: experimental
 
 AsynchronousSpellCheckingEnabled:
   type: bool
@@ -1203,3 +1207,4 @@ ResourceLoadStatisticsDebugMode:
   humanReadableDescription: "Intelligent Tracking Prevention Debug Mode"
   category: experimental
   webcoreBinding: RuntimeEnabledFeatures
+