Web Animations should be off by default and enabled as an experimental feature
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2017 21:04:24 +0000 (21:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2017 21:04:24 +0000 (21:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167115
<rdar://problem/30048963>

Patch by Antoine Quint <graouts@apple.com> on 2017-01-20
Reviewed by Joseph Pecoraro.

Source/WebCore:

Conditionalize the existing parts of the Web Animations API so that they may be
toggled at runtime.

* animation/Animatable.idl:
* animation/AnimationEffect.idl:
* animation/AnimationTimeline.idl:
* animation/DocumentAnimation.idl:
* animation/DocumentTimeline.idl:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::reset):
* page/RuntimeEnabledFeatures.h:

Source/WebKit2:

Promote, or relegate depending on how you see things, the Web Animations preference
to an experimental feature.

* Shared/WebPreferencesDefinitions.h:

Tools:

Turn Web Animations on in DRT.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):

Websites/webkit.org:

Add a test for Web Animations feature detection.

* experimental-features.html:

LayoutTests:

No need for an explicit preference anymore.

* webanimations/script-tests/Document.js:

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

19 files changed:
LayoutTests/ChangeLog
LayoutTests/webanimations/script-tests/Document.js
Source/WebCore/ChangeLog
Source/WebCore/animation/Animatable.idl
Source/WebCore/animation/AnimationEffect.idl
Source/WebCore/animation/AnimationTimeline.idl
Source/WebCore/animation/DocumentAnimation.idl
Source/WebCore/animation/DocumentTimeline.idl
Source/WebCore/animation/KeyframeEffect.idl
Source/WebCore/animation/WebAnimation.idl
Source/WebCore/page/RuntimeEnabledFeatures.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Websites/webkit.org/ChangeLog
Websites/webkit.org/experimental-features.html

index afb5f56..dda898a 100644 (file)
@@ -1,3 +1,15 @@
+2017-01-20  Antoine Quint  <graouts@apple.com>
+
+        Web Animations should be off by default and enabled as an experimental feature
+        https://bugs.webkit.org/show_bug.cgi?id=167115
+        <rdar://problem/30048963>
+
+        Reviewed by Joseph Pecoraro.
+
+        No need for an explicit preference anymore.
+
+        * webanimations/script-tests/Document.js:
+
 2017-01-20  Ryan Haddad  <ryanhaddad@apple.com>
 
         Skipping pointer-lock tests on macOS WK2.
index 81df4b3..c640aa0 100644 (file)
@@ -1,9 +1,5 @@
 description("Web Animation API: Document interface extension test.");
 
-// Enable Web Animations API.
-if (window.testRunner)
-    window.testRunner.overridePreference("WebKitWebAnimationsEnabled", "1");
-
 var iframe = document.getElementById("iframe");
 var target = document.getElementById("target");
 
index 3f6eb5e..76d1303 100644 (file)
@@ -1,5 +1,27 @@
 2017-01-20  Antoine Quint  <graouts@apple.com>
 
+        Web Animations should be off by default and enabled as an experimental feature
+        https://bugs.webkit.org/show_bug.cgi?id=167115
+        <rdar://problem/30048963>
+
+        Reviewed by Joseph Pecoraro.
+
+        Conditionalize the existing parts of the Web Animations API so that they may be
+        toggled at runtime.
+
+        * animation/Animatable.idl:
+        * animation/AnimationEffect.idl:
+        * animation/AnimationTimeline.idl:
+        * animation/DocumentAnimation.idl:
+        * animation/DocumentTimeline.idl:
+        * animation/KeyframeEffect.idl:
+        * animation/WebAnimation.idl:
+        * page/RuntimeEnabledFeatures.cpp:
+        (WebCore::RuntimeEnabledFeatures::reset):
+        * page/RuntimeEnabledFeatures.h:
+
+2017-01-20  Antoine Quint  <graouts@apple.com>
+
         [Modern Media Controls] Turn modern media controls on by default
         https://bugs.webkit.org/show_bug.cgi?id=165668
 
index 33d44f1..df5158d 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     NoInterfaceObject
 ] interface Animatable {
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
index b10c623..8a4b508 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     InterfaceName=AnimationEffectReadOnly,
     SkipVTableValidation
 ] interface AnimationEffect {
index 3b61b10..1c67a4a 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     CustomToJSObject,
     ImplementationLacksVTable
 ] interface AnimationTimeline {
index 69d6bb6..610d34a 100644 (file)
@@ -27,7 +27,8 @@
  */
 
 [
-    Conditional=WEB_ANIMATIONS
+    Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
 ] partial interface Document {
     readonly attribute DocumentTimeline timeline;
     sequence<WebAnimation> getAnimations();
index b7a5a8a..9413ca6 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     ImplementationLacksVTable,
     // FIXME: Should be DOMHighResTimeStamp rather than double (e.g. see Performance.now()).
     Constructor(double originTime),
index bd11ecc..c671967 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     // FIXME: Constructor stub only at the moment (should accept PseudoElement target, frames and options).
     Constructor([Default=Undefined] Element? target)
     // FIXME: Add interface for and inherit from KeyframeEffectReadOnly.
index 4709fea..048581d 100644 (file)
@@ -28,6 +28,7 @@
 
 [
     Conditional=WEB_ANIMATIONS,
+    EnabledAtRuntime=WebAnimations,
     InterfaceName=Animation,
     ImplementationLacksVTable,
     Constructor([Default=Undefined] AnimationEffect? effect, [Default=Undefined] AnimationTimeline? timeline)
index 9c70c89..ef4eba9 100644 (file)
@@ -103,9 +103,6 @@ void RuntimeEnabledFeatures::reset()
 #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
     m_areAnimationTriggersEnabled = false;
 #endif
-#if ENABLE(WEB_ANIMATIONS)
-    m_areWebAnimationsEnabled = false;
-#endif
 #if ENABLE(CSS_GRID_LAYOUT)
     m_cssGridLayoutEnabled = true;
 #endif
index 26fa2a0..b993698 100644 (file)
@@ -332,7 +332,7 @@ private:
 #endif
 
 #if ENABLE(WEB_ANIMATIONS)
-    bool m_areWebAnimationsEnabled;
+    bool m_areWebAnimationsEnabled { false };
 #endif
     
     bool m_isShadowDOMEnabled;
index 2006b04..bb46b60 100644 (file)
@@ -1,5 +1,18 @@
 2017-01-20  Antoine Quint  <graouts@apple.com>
 
+        Web Animations should be off by default and enabled as an experimental feature
+        https://bugs.webkit.org/show_bug.cgi?id=167115
+        <rdar://problem/30048963>
+
+        Reviewed by Joseph Pecoraro.
+
+        Promote, or relegate depending on how you see things, the Web Animations preference
+        to an experimental feature.
+
+        * Shared/WebPreferencesDefinitions.h:
+
+2017-01-20  Antoine Quint  <graouts@apple.com>
+
         [Modern Media Controls] Turn modern media controls on by default
         https://bugs.webkit.org/show_bug.cgi?id=165668
 
index 539b8af..e0a6482 100644 (file)
     macro(ForceSoftwareWebGLRendering, forceSoftwareWebGLRendering, Bool, bool, false, "", "") \
     macro(Accelerated2dCanvasEnabled, accelerated2dCanvasEnabled, Bool, bool, false, "", "") \
     macro(CSSAnimationTriggersEnabled, cssAnimationTriggersEnabled, Bool, bool, true, "", "") \
-    macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "", "") \
     macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false, "", "") \
     macro(TabsToLinks, tabsToLinks, Bool, bool, DEFAULT_WEBKIT_TABSTOLINKS_ENABLED, "", "") \
     macro(DNSPrefetchingEnabled, dnsPrefetchingEnabled, Bool, bool, false, "", "") \
     macro(ModernMediaControlsEnabled, modernMediaControlsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Modern Media Controls", "Use modern media controls look") \
     macro(InputEventsEnabled, inputEventsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Input Events", "Enable InputEvents support") \
     macro(SubtleCryptoEnabled, subtleCryptoEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubtleCrypto", "Enable SubtleCrypto support") \
+    macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "WebGL 2.0", "WebGL 2 prototype") \
     \
 
index d86a8fe..ddec9ed 100644 (file)
@@ -1,3 +1,18 @@
+2017-01-20  Antoine Quint  <graouts@apple.com>
+
+        Web Animations should be off by default and enabled as an experimental feature
+        https://bugs.webkit.org/show_bug.cgi?id=167115
+        <rdar://problem/30048963>
+
+        Reviewed by Joseph Pecoraro.
+
+        Turn Web Animations on in DRT.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebPreferencesToConsistentValues):
+
 2017-01-20  Youenn Fablet  <youenn@apple.com>
 
         [WebRTC] Add libwebrtc build infrastructure
index 74ee7e5..7de5a1f 100644 (file)
@@ -1001,6 +1001,7 @@ static void resetWebPreferencesToConsistentValues(const TestOptions& options)
 
     [preferences setMediaStreamEnabled:YES];
     [preferences setPeerConnectionEnabled:YES];
+    [preferences setWebAnimationsEnabled:YES];
 
     [WebPreferences _clearNetworkLoaderSession];
     [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
index e630a36..a9fb419 100644 (file)
@@ -862,6 +862,7 @@ static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences)
     prefsPrivate3->setCustomElementsEnabled(TRUE);
 
     prefsPrivate3->setModernMediaControlsEnabled(FALSE);
+    prefsPrivate3->setWebAnimationsEnabled(TRUE);
 
     setAlwaysAcceptCookies(false);
 }
index a75bc4b..5159477 100644 (file)
@@ -1,3 +1,15 @@
+2017-01-20  Antoine Quint  <graouts@apple.com>
+
+        Web Animations should be off by default and enabled as an experimental feature
+        https://bugs.webkit.org/show_bug.cgi?id=167115
+        <rdar://problem/30048963>
+
+        Reviewed by Joseph Pecoraro.
+
+        Add a test for Web Animations feature detection.
+
+        * experimental-features.html:
+
 2017-01-19  Joseph Pecoraro  <pecoraro@apple.com>
 
         Include SubtleCrypto test on experimental-features test page
index fd2c2d7..f32f13c 100644 (file)
@@ -106,6 +106,10 @@ function testSubtleCrypto() {
     return window.crypto.subtle;
 }
 
+function testWebAnimations() {
+    return !!window.Animation;
+}
+
 window.addEventListener("load", function () {
     Array.from(document.querySelectorAll(".test")).forEach(element => {
         var enabled = false;
@@ -134,6 +138,7 @@ window.addEventListener("load", function () {
         <div class="test" id="InputEvents"><p>HTML Input Events</p></div>
         <div class="test" id="SubtleCrypto"><p>SubtleCrypto</p></div>
         <div class="test" id="VariationFonts"><p>Variation Fonts</p></div>
+        <div class="test" id="WebAnimations"><p>Web Animations</p></div>
         <div class="test" id="WebGL2"><p>WebGL 2.0</p></div>
     </div>
 </body>