Changeset 229334 in webkit


Ignore:
Timestamp:
Mar 6, 2018 11:50:55 AM (6 years ago)
Author:
commit-queue@webkit.org
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 <Antoine Quint> 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:
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r229333 r229334  
     12018-03-06  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
     4        https://bugs.webkit.org/show_bug.cgi?id=183370
     5        <rdar://problem/38180729>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
     10        involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
     11        default while we bring this feature up.
     12
     13        * page/RuntimeEnabledFeatures.h:
     14        (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
     15        (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const):
     16
    1172018-03-06  Daniel Bates  <dabates@apple.com>
    218
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r228483 r229334  
    169169    bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; }
    170170
     171    void setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool areEnabled) { m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled = areEnabled; }
     172    bool cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled() const { return m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled; }
     173
    171174#if ENABLE(WEBGL2)
    172175    void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; }
     
    332335
    333336    bool m_areWebAnimationsEnabled { false };
     337    bool m_areCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled { false };
    334338
    335339#if ENABLE(WEBGL2)
  • trunk/Source/WebKit/ChangeLog

    r229320 r229334  
     12018-03-06  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
     4        https://bugs.webkit.org/show_bug.cgi?id=183370
     5        <rdar://problem/38180729>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
     10        involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
     11        default while we bring this feature up.
     12
     13        * Shared/WebPreferences.yaml:
     14        * UIProcess/API/C/WKPreferences.cpp:
     15        (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
     16        (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
     17        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     18        * UIProcess/API/Cocoa/WKPreferences.mm:
     19        (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
     20        (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
     21        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
     22        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     23        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
     24        (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
     25        * WebProcess/InjectedBundle/InjectedBundle.h:
     26
    1272018-03-06  Ms2ger  <Ms2ger@igalia.com>
    228
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r228486 r229334  
    9999  webcoreName: animationTriggersEnabled
    100100  condition: ENABLE(CSS_ANIMATIONS_LEVEL_2)
     101
     102CSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:
     103  type: bool
     104  defaultValue: false
     105  webcoreBinding: RuntimeEnabledFeatures
    101106
    102107ForceFTPDirectoryListings:
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp

    r228486 r229334  
    516516}
    517517
     518void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef, bool flag)
     519{
     520    toImpl(preferencesRef)->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(flag);
     521}
     522
     523bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef)
     524{
     525    return toImpl(preferencesRef)->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
     526}
     527
    518528void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
    519529{
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h

    r228486 r229334  
    120120WK_EXPORT bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef);
    121121
     122// Defaults to false
     123WK_EXPORT void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef, bool flag);
     124WK_EXPORT bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef);
     125
    122126// Defaults to false.
    123127WK_EXPORT void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef, bool);
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

    r229294 r229334  
    973973}
    974974
     975- (void)_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:(BOOL)enabled
     976{
     977    _preferences->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
     978}
     979
     980- (BOOL)_cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled
     981{
     982    return _preferences->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
     983}
     984
    975985- (void)_setStandardFontFamily:(NSString *)family
    976986{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h

    r229294 r229334  
    159159@property (nonatomic, setter=_setViewGestureDebuggingEnabled:) BOOL _viewGestureDebuggingEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    160160@property (nonatomic, setter=_setCSSAnimationTriggersEnabled:) BOOL _cssAnimationTriggersEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
     161@property (nonatomic, setter=_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:) BOOL _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    161162@property (nonatomic, setter=_setStandardFontFamily:) NSString *_standardFontFamily WK_API_AVAILABLE(macosx(WK_MAC_TBA));
    162163@property (nonatomic, setter=_setNotificationsEnabled:) BOOL _notificationsEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

    r227687 r229334  
    193193        RuntimeEnabledFeatures::sharedFeatures().setWebAnimationsEnabled(enabled);
    194194
     195    if (preference == "WebKitCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled")
     196        RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
     197
    195198    if (preference == "WebKitCacheAPIEnabled")
    196199        RuntimeEnabledFeatures::sharedFeatures().setCacheAPIEnabled(enabled);
     
    615618}
    616619
     620void InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool enabled)
     621{
     622    RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
     623}
     624
    617625} // namespace WebKit
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h

    r228502 r229334  
    152152    void setCSSAnimationTriggersEnabled(bool);
    153153    void setWebAnimationsEnabled(bool);
     154    void setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(bool);
    154155    void dispatchPendingLoadRequests();
    155156
Note: See TracChangeset for help on using the changeset viewer.