[Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2020 13:38:24 +0000 (13:38 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jan 2020 13:38:24 +0000 (13:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206173
<rdar://problem/58527432>

Reviewed by Dean Jackson.

Source/WebCore:

Make the timeline property of Animation read-write only if the new WebAnimationsMutableTimelines runtime flag is enabled.

* animation/WebAnimation.idl: Make the "timeline" property conditionally read-write if WebAnimationsMutableTimelines is enabled.
* bindings/js/WebCoreBuiltinNames.h: With the new RuntimeConditionallyReadWrite property used in WebAnimation.idl, it is necessary
to declare the name of the affected property, in this case "timeline", in WebCoreBuiltinNames.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled):
(WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const):

Source/WebKit:

Add a new WebAnimationsMutableTimelines runtime flag.

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

Add a new WebAnimationsMutableTimelines runtime flag.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences webAnimationsMutableTimelinesEnabled]):
(-[WebPreferences setWebAnimationsMutableTimelinesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

Add a new WebAnimationsMutableTimelines runtime flag.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::setWebAnimationsMutableTimelinesEnabled):
(WebPreferences::webAnimationsMutableTimelinesEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Manually enable the new WebAnimationsMutableTimelines runtime flag in DumpRenderTree.

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

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

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/animation/WebAnimation.idl
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/win/WebPreferences.cpp
Source/WebKitLegacy/win/WebPreferences.h
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp

index 84f0132..b6ec9c8 100644 (file)
@@ -1,3 +1,20 @@
+2020-01-27  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206173
+        <rdar://problem/58527432>
+
+        Reviewed by Dean Jackson.
+
+        Make the timeline property of Animation read-write only if the new WebAnimationsMutableTimelines runtime flag is enabled.
+
+        * animation/WebAnimation.idl: Make the "timeline" property conditionally read-write if WebAnimationsMutableTimelines is enabled.
+        * bindings/js/WebCoreBuiltinNames.h: With the new RuntimeConditionallyReadWrite property used in WebAnimation.idl, it is necessary
+        to declare the name of the affected property, in this case "timeline", in WebCoreBuiltinNames.
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled):
+        (WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const):
+
 2020-01-27  Noam Rosenthal  <noam@webkit.org>
 
         -webkit-image-set should support resolution units other than 'x'
index 2949e07..f0d82df 100644 (file)
@@ -45,7 +45,7 @@ enum AnimationReplaceState {
 ] interface WebAnimation : EventTarget {
     attribute DOMString id;
     attribute AnimationEffect? effect;
-    attribute AnimationTimeline? timeline;
+    [RuntimeConditionallyReadWrite=WebAnimationsMutableTimelines] attribute AnimationTimeline? timeline;
     attribute double? startTime;
     [MayThrowException, ImplementedAs=bindingsCurrentTime] attribute double? currentTime;
     attribute double playbackRate;
index 228c8e9..105083a 100644 (file)
@@ -352,6 +352,7 @@ namespace WebCore {
     macro(streamWritable) \
     macro(structuredCloneArrayBuffer) \
     macro(structuredCloneArrayBufferView) \
+    macro(timeline) \
     macro(top) \
     macro(underlyingByteSource) \
     macro(underlyingSink) \
index 0012c1e..f3c992d 100644 (file)
@@ -112,6 +112,9 @@ public:
     void setWebAnimationsCompositeOperationsEnabled(bool areEnabled) { m_areWebAnimationsCompositeOperationsEnabled = areEnabled; }
     bool webAnimationsCompositeOperationsEnabled() const { return m_areWebAnimationsCompositeOperationsEnabled; }
 
+    void setWebAnimationsMutableTimelinesEnabled(bool areEnabled) { m_areWebAnimationsMutableTimelinesEnabled = areEnabled; }
+    bool webAnimationsMutableTimelinesEnabled() const { return m_areWebAnimationsMutableTimelinesEnabled; }
+
     void setImageBitmapEnabled(bool isEnabled) { m_isImageBitmapEnabled = isEnabled; }
     bool imageBitmapEnabled() const { return m_isImageBitmapEnabled; }
 
@@ -423,6 +426,7 @@ private:
     bool m_areWebAnimationsEnabled { true };
     bool m_isWebAnimationsCSSIntegrationEnabled { true };
     bool m_areWebAnimationsCompositeOperationsEnabled { false };
+    bool m_areWebAnimationsMutableTimelinesEnabled { false };
     bool m_isImageBitmapEnabled { true };
 #if ENABLE(OFFSCREEN_CANVAS)
     bool m_isOffscreenCanvasEnabled { false };
index fa7d96b..43d1fac 100644 (file)
@@ -1,3 +1,15 @@
+2020-01-27  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206173
+        <rdar://problem/58527432>
+
+        Reviewed by Dean Jackson.
+
+        Add a new WebAnimationsMutableTimelines runtime flag.
+
+        * Shared/WebPreferences.yaml:
+
 2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK][WPE] QR code not loaded in web.whatsapp.com
index f2fd636..95d832a 100644 (file)
@@ -1354,6 +1354,14 @@ WebAnimationsCompositeOperationsEnabled:
   category: experimental
   webcoreBinding: RuntimeEnabledFeatures
 
+WebAnimationsMutableTimelinesEnabled:
+  type: bool
+  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
+  humanReadableName: "Web Animations mutable timelines"
+  humanReadableDescription: "Support for setting the timeline property of an Animation object"
+  category: experimental
+  webcoreBinding: RuntimeEnabledFeatures
+
 WebGL2Enabled:
   type: bool
   defaultValue: false
index 8b8fc2d..2f25410 100644 (file)
@@ -1,3 +1,21 @@
+2020-01-27  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206173
+        <rdar://problem/58527432>
+
+        Reviewed by Dean Jackson.
+
+        Add a new WebAnimationsMutableTimelines runtime flag.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences webAnimationsMutableTimelinesEnabled]):
+        (-[WebPreferences setWebAnimationsMutableTimelinesEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2020-01-27  Simon Fraser  <simon.fraser@apple.com>
 
         REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
index 8229773..17cf5f1 100644 (file)
@@ -54,6 +54,7 @@
 #define WebKitJavaScriptMarkupEnabledPreferenceKey @"WebKitJavaScriptMarkupEnabled"
 #define WebKitWebAnimationsEnabledPreferenceKey @"WebKitWebAnimationsEnabled"
 #define WebKitWebAnimationsCompositeOperationsEnabledPreferenceKey @"WebKitWebAnimationsCompositeOperationsEnabled"
+#define WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey @"WebKitWebAnimationsMutableTimelinesEnabled"
 #define WebKitPointerEventsEnabledPreferenceKey @"WebKitPointerEventsEnabled"
 #define WebKitSyntheticEditingCommandsEnabledPreferenceKey @"WebKitSyntheticEditingCommandsEnabled"
 #define WebKitWebSecurityEnabledPreferenceKey @"WebKitWebSecurityEnabled"
index 577400b..b4a014b 100644 (file)
@@ -3226,6 +3226,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitWebAnimationsCompositeOperationsEnabledPreferenceKey];
 }
 
+- (BOOL)webAnimationsMutableTimelinesEnabled
+{
+    return [self _boolValueForKey:WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey];
+}
+
+- (void)setWebAnimationsMutableTimelinesEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey];
+}
+
 - (BOOL)pointerEventsEnabled
 {
     return [self _boolValueForKey:WebKitPointerEventsEnabledPreferenceKey];
index 8d217f1..934ffe5 100644 (file)
@@ -582,6 +582,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (void)setWebAnimationsCompositeOperationsEnabled:(BOOL)flag;
 - (BOOL)webAnimationsCompositeOperationsEnabled;
 
+- (void)setWebAnimationsMutableTimelinesEnabled:(BOOL)flag;
+- (BOOL)webAnimationsMutableTimelinesEnabled;
+
 - (void)setPointerEventsEnabled:(BOOL)flag;
 - (BOOL)pointerEventsEnabled;
 
index 7b7152c..6d0daa6 100644 (file)
@@ -3182,6 +3182,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
     RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled([preferences webAnimationsEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsCompositeOperationsEnabled([preferences webAnimationsCompositeOperationsEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsMutableTimelinesEnabled([preferences webAnimationsMutableTimelinesEnabled]);
 
 #if ENABLE(POINTER_EVENTS)
     RuntimeEnabledFeatures::sharedFeatures().setPointerEventsEnabled([preferences pointerEventsEnabled]);
index dcbdbef..337c3cd 100644 (file)
@@ -1,3 +1,23 @@
+2020-01-27  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206173
+        <rdar://problem/58527432>
+
+        Reviewed by Dean Jackson.
+
+        Add a new WebAnimationsMutableTimelines runtime flag.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::setWebAnimationsMutableTimelinesEnabled):
+        (WebPreferences::webAnimationsMutableTimelinesEnabled):
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2020-01-27  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
index 8447f63..ffa10a0 100644 (file)
@@ -252,6 +252,8 @@ interface IWebPreferencesPrivate7 : IWebPreferencesPrivate6
     HRESULT setAsyncClipboardAPIEnabled([in] BOOL enabled);
     HRESULT webAnimationsCompositeOperationsEnabled([out, retval] BOOL*);
     HRESULT setWebAnimationsCompositeOperationsEnabled([in] BOOL enabled);
+    HRESULT webAnimationsMutableTimelinesEnabled([out, retval] BOOL*);
+    HRESULT setWebAnimationsMutableTimelinesEnabled([in] BOOL enabled);
     HRESULT aspectRatioOfImgFromWidthAndHeightEnabled([out, retval] BOOL*);
     HRESULT setAspectRatioOfImgFromWidthAndHeightEnabled([in] BOOL enabled);
     HRESULT setWebSQLEnabled([in] BOOL enabled);
index 9576512..7a058fa 100644 (file)
 
 #define WebKitWebAnimationsCompositeOperationsEnabledPreferenceKey "WebKitWebAnimationsCompositeOperationsEnabled"
 
+#define WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey "WebKitWebAnimationsMutableTimelinesEnabled"
+
 #define WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey "WebKitWebAnimationsCSSIntegrationEnabled"
 
 #define WebKitUserTimingEnabledPreferenceKey "WebKitUserTimingEnabled"
index ee5f440..24fc269 100644 (file)
@@ -317,6 +317,8 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitWebAnimationsCompositeOperationsEnabledPreferenceKey), kCFBooleanFalse);
 
+    CFDictionaryAddValue(defaults, CFSTR(WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey), kCFBooleanFalse);
+
     CFDictionaryAddValue(defaults, CFSTR(WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey), kCFBooleanFalse);
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitUserTimingEnabledPreferenceKey), kCFBooleanFalse);
@@ -2369,6 +2371,20 @@ HRESULT WebPreferences::webAnimationsCompositeOperationsEnabled(_Out_ BOOL* enab
     return S_OK;
 }
 
+HRESULT WebPreferences::setWebAnimationsMutableTimelinesEnabled(BOOL enabled)
+{
+    setBoolValue(WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey, enabled);
+    return S_OK;
+}
+
+HRESULT WebPreferences::webAnimationsMutableTimelinesEnabled(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitWebAnimationsMutableTimelinesEnabledPreferenceKey);
+    return S_OK;
+}
+
 HRESULT WebPreferences::setUserTimingEnabled(BOOL enabled)
 {
     setBoolValue(WebKitUserTimingEnabledPreferenceKey, enabled);
index 2a89f6b..1847dbe 100644 (file)
@@ -297,6 +297,8 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setAsyncClipboardAPIEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE webAnimationsCompositeOperationsEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setWebAnimationsCompositeOperationsEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE webAnimationsMutableTimelinesEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setWebAnimationsMutableTimelinesEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE aspectRatioOfImgFromWidthAndHeightEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setAspectRatioOfImgFromWidthAndHeightEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE webSQLEnabled(_Out_ BOOL*);
index e48bfa5..e38b53b 100644 (file)
@@ -5265,6 +5265,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsCompositeOperationsEnabled(!!enabled);
 
+    hr = prefsPrivate->webAnimationsMutableTimelinesEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsMutableTimelinesEnabled(!!enabled);
+
     hr = prefsPrivate->webAnimationsCSSIntegrationEnabled(&enabled);
     if (FAILED(hr))
         return hr;
index b6444d1..fdd69fa 100644 (file)
@@ -1,3 +1,18 @@
+2020-01-28  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206173
+        <rdar://problem/58527432>
+
+        Reviewed by Dean Jackson.
+
+        Manually enable the new WebAnimationsMutableTimelines runtime flag in DumpRenderTree.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (enableExperimentalFeatures):
+
 2020-01-27  Aakash Jain  <aakash_jain@apple.com>
 
         [ews] Add method to fetch cq+ patches from Bugzilla
index dcc7179..3fe1740 100644 (file)
@@ -865,6 +865,7 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setFetchAPIKeepAliveEnabled:YES];
     [preferences setWebAnimationsEnabled:YES];
     [preferences setWebAnimationsCompositeOperationsEnabled:YES];
+    [preferences setWebAnimationsMutableTimelinesEnabled:YES];
     [preferences setWebGL2Enabled:YES];
     // FIXME: AsyncFrameScrollingEnabled
     [preferences setCacheAPIEnabled:NO];
index 89c4dd7..1f426b5 100644 (file)
@@ -798,6 +798,7 @@ static void enableExperimentalFeatures(IWebPreferences* preferences)
     prefsPrivate->setResizeObserverEnabled(TRUE);
     prefsPrivate->setWebAnimationsEnabled(TRUE);
     prefsPrivate->setWebAnimationsCompositeOperationsEnabled(TRUE);
+    prefsPrivate->setWebAnimationsMutableTimelinesEnabled(TRUE);
     prefsPrivate->setServerTimingEnabled(TRUE);
     prefsPrivate->setAspectRatioOfImgFromWidthAndHeightEnabled(TRUE);
     prefsPrivate->setRenderingUpdateThrottlingEnabled(FALSE);