Title: [229334] trunk/Source
Revision
229334
Author
commit-qu...@webkit.org
Date
2018-03-06 11:50:55 -0800 (Tue, 06 Mar 2018)

Log Message

[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>

Patch by Antoine Quint <grao...@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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (229333 => 229334)


--- trunk/Source/WebCore/ChangeLog	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebCore/ChangeLog	2018-03-06 19:50:55 UTC (rev 229334)
@@ -1,3 +1,19 @@
+2018-03-06  Antoine Quint  <grao...@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  <daba...@apple.com>
 
         Make more use of USE(OPENGL_ES) and replace typedefs with C++11 using statements

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (229333 => 229334)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2018-03-06 19:50:55 UTC (rev 229334)
@@ -168,6 +168,9 @@
     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 @@
 #endif
 
     bool m_areWebAnimationsEnabled { false };
+    bool m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled { false };
 
 #if ENABLE(WEBGL2)
     bool m_isWebGL2Enabled { false };

Modified: trunk/Source/WebKit/ChangeLog (229333 => 229334)


--- trunk/Source/WebKit/ChangeLog	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/ChangeLog	2018-03-06 19:50:55 UTC (rev 229334)
@@ -1,3 +1,29 @@
+2018-03-06  Antoine Quint  <grao...@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  <ms2...@igalia.com>
 
         [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (229333 => 229334)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-03-06 19:50:55 UTC (rev 229334)
@@ -99,6 +99,11 @@
   webcoreName: animationTriggersEnabled
   condition: ENABLE(CSS_ANIMATIONS_LEVEL_2)
 
+CSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:
+  type: bool
+  defaultValue: false
+  webcoreBinding: RuntimeEnabledFeatures
+
 ForceFTPDirectoryListings:
   type: bool
   defaultValue: false

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (229333 => 229334)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2018-03-06 19:50:55 UTC (rev 229334)
@@ -515,6 +515,16 @@
     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);

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (229333 => 229334)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2018-03-06 19:50:55 UTC (rev 229334)
@@ -119,6 +119,10 @@
 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);

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (229333 => 229334)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2018-03-06 19:50:55 UTC (rev 229334)
@@ -972,6 +972,16 @@
     return _preferences->cssAnimationTriggersEnabled();
 }
 
+- (void)_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:(BOOL)enabled
+{
+    _preferences->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
+}
+
+- (BOOL)_cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled
+{
+    return _preferences->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
+}
+
 - (void)_setStandardFontFamily:(NSString *)family
 {
     _preferences->setStandardFontFamily(family);

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (229333 => 229334)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2018-03-06 19:50:55 UTC (rev 229334)
@@ -158,6 +158,7 @@
 @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));

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (229333 => 229334)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2018-03-06 19:50:55 UTC (rev 229334)
@@ -192,6 +192,9 @@
     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 @@
     RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled(enabled);
 }
 
+void InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool enabled)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h (229333 => 229334)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2018-03-06 19:46:46 UTC (rev 229333)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2018-03-06 19:50:55 UTC (rev 229334)
@@ -151,6 +151,7 @@
     void setSerialLoadingEnabled(bool);
     void setCSSAnimationTriggersEnabled(bool);
     void setWebAnimationsEnabled(bool);
+    void setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool);
     void dispatchPendingLoadRequests();
 
 #if PLATFORM(COCOA) && WK_API_ENABLED
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to