[Web Animations] Add a new runtime flag to control whether CSS Animations and CSS...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2018 19:50:55 +0000 (19:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2018 19:50:55 +0000 (19:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183370
<rdar://problem/38180729>

Patch by Antoine Quint <graouts@apple.com> on 2018-03-06
Reviewed by Dean Jackson.

Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
default while we bring this feature up.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
(WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
(WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
(-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
(WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
* WebProcess/InjectedBundle/InjectedBundle.h:

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

Source/WebCore/ChangeLog
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h

index 868c187..4f2db24 100644 (file)
@@ -1,3 +1,19 @@
+2018-03-06  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
+        https://bugs.webkit.org/show_bug.cgi?id=183370
+        <rdar://problem/38180729>
+
+        Reviewed by Dean Jackson.
+
+        Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
+        involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
+        default while we bring this feature up.
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
+        (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
+
 2018-03-06  Daniel Bates  <dabates@apple.com>
 
         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements
index 25fe606..0c5be64 100644 (file)
@@ -168,6 +168,9 @@ public:
     void setWebAnimationsEnabled(bool areEnabled) { m_areWebAnimationsEnabled = areEnabled; }
     bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; }
 
+    void setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool areEnabled) { m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled = areEnabled; }
+    bool cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled() const { return m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled; }
+
 #if ENABLE(WEBGL2)
     void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; }
     bool webGL2Enabled() const { return m_isWebGL2Enabled; }
@@ -331,6 +334,7 @@ private:
 #endif
 
     bool m_areWebAnimationsEnabled { false };
+    bool m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled { false };
 
 #if ENABLE(WEBGL2)
     bool m_isWebGL2Enabled { false };
index 8413f87..8d3e1c6 100644 (file)
@@ -1,3 +1,29 @@
+2018-03-06  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
+        https://bugs.webkit.org/show_bug.cgi?id=183370
+        <rdar://problem/38180729>
+
+        Reviewed by Dean Jackson.
+
+        Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
+        involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
+        default while we bring this feature up.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
+        (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
+        (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
 
         [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().
index b826e4b..a240a88 100644 (file)
@@ -99,6 +99,11 @@ CSSAnimationTriggersEnabled:
   webcoreName: animationTriggersEnabled
   condition: ENABLE(CSS_ANIMATIONS_LEVEL_2)
 
+CSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:
+  type: bool
+  defaultValue: false
+  webcoreBinding: RuntimeEnabledFeatures
+
 ForceFTPDirectoryListings:
   type: bool
   defaultValue: false
index 8a73bdb..2438547 100644 (file)
@@ -515,6 +515,16 @@ bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->webAnimationsEnabled();
 }
 
+void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(flag);
+}
+
+bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
+}
+
 void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setNeedsSiteSpecificQuirks(flag);
index 0a85f69..809b318 100644 (file)
@@ -119,6 +119,10 @@ WK_EXPORT bool WKPreferencesGetCSSAnimationTriggersEnabled(WKPreferencesRef);
 WK_EXPORT void WKPreferencesSetWebAnimationsEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef);
+
 // Defaults to false.
 WK_EXPORT void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef);
index 51f5ae9..b8bf4fe 100644 (file)
@@ -972,6 +972,16 @@ static WebCore::EditableLinkBehavior toEditableLinkBehavior(_WKEditableLinkBehav
     return _preferences->cssAnimationTriggersEnabled();
 }
 
+- (void)_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:(BOOL)enabled
+{
+    _preferences->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
+}
+
+- (BOOL)_cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled
+{
+    return _preferences->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
+}
+
 - (void)_setStandardFontFamily:(NSString *)family
 {
     _preferences->setStandardFontFamily(family);
index 29b7669..5712554 100644 (file)
@@ -158,6 +158,7 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) {
 @property (nonatomic, setter=_setMediaSourceEnabled:) BOOL _mediaSourceEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, setter=_setViewGestureDebuggingEnabled:) BOOL _viewGestureDebuggingEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, setter=_setCSSAnimationTriggersEnabled:) BOOL _cssAnimationTriggersEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
+@property (nonatomic, setter=_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:) BOOL _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, setter=_setStandardFontFamily:) NSString *_standardFontFamily WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, setter=_setNotificationsEnabled:) BOOL _notificationsEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 @property (nonatomic, setter=_setBackspaceKeyNavigationEnabled:) BOOL _backspaceKeyNavigationEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
index 9d827d5..aa2308a 100644 (file)
@@ -192,6 +192,9 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
     if (preference == "WebKitWebAnimationsEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled(enabled);
 
+    if (preference == "WebKitCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
+
     if (preference == "WebKitCacheAPIEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setCacheAPIEnabled(enabled);
 
@@ -614,4 +617,9 @@ void InjectedBundle::setWebAnimationsEnabled(bool enabled)
     RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled(enabled);
 }
 
+void InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
+}
+
 } // namespace WebKit
index d0ce7ce..abbf397 100644 (file)
@@ -151,6 +151,7 @@ public:
     void setSerialLoadingEnabled(bool);
     void setCSSAnimationTriggersEnabled(bool);
     void setWebAnimationsEnabled(bool);
+    void setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool);
     void dispatchPendingLoadRequests();
 
 #if PLATFORM(COCOA) && WK_API_ENABLED