Bug 183370

Summary: [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=183552
Attachments:
Description Flags
Patch none

Description Antoine Quint 2018-03-06 08:35:07 PST
We need a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline or using CSSAnimationController.
Comment 1 Antoine Quint 2018-03-06 08:35:22 PST
<rdar://problem/38180729>
Comment 2 Antoine Quint 2018-03-06 08:50:27 PST
Created attachment 335100 [details]
Patch
Comment 3 Dean Jackson 2018-03-06 09:51:32 PST
Comment on attachment 335100 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=335100&action=review

You should check with Weinig here.

> Source/WebKit/UIProcess/API/C/WKPreferences.cpp:527
> +void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef, bool flag)
> +{
> +    toImpl(preferencesRef)->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(flag);
> +}
> +
> +bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef preferencesRef)
> +{
> +    return toImpl(preferencesRef)->cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled();
> +}
> +

Don't need this. Remove it.

> Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:125
> +// Defaults to false
> +WK_EXPORT void WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef, bool flag);
> +WK_EXPORT bool WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(WKPreferencesRef);
> +

Ditto.

> Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:979
> +- (void)_setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:(BOOL)enabled
> +{
> +    _preferences->setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
> +}
> +

Actually I'm not sure if you need any of this other than the .yaml change.

> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:196
> +    if (preference == "WebKitCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled")
> +        RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);

Maybe I misunderstand the code, but I thought you didn't need to do this explicitly because the .yaml is generating code for it.
Comment 4 Tim Horton 2018-03-06 10:47:08 PST
Comment on attachment 335100 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=335100&action=review

>> Source/WebKit/UIProcess/API/C/WKPreferences.cpp:527
>> +
> 
> Don't need this. Remove it.

Some clients still use this API

>> Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp:196
>> +        RuntimeEnabledFeatures::sharedFeatures().setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled(enabled);
> 
> Maybe I misunderstand the code, but I thought you didn't need to do this explicitly because the .yaml is generating code for it.

Maybe plumbing to overrideBoolPreferenceForTestRunner isn't generated yet?
Comment 5 WebKit Commit Bot 2018-03-06 11:51:01 PST
Comment on attachment 335100 [details]
Patch

Clearing flags on attachment: 335100

Committed r229334: <https://trac.webkit.org/changeset/229334>
Comment 6 WebKit Commit Bot 2018-03-06 11:51:02 PST
All reviewed patches have been landed.  Closing bug.