Intent to Deprecate and Remove: Throwing on unimplemented (but valid) CompositeOperation values in WebAnimationsAPI.

53 views
Skip to first unread message

smcg...@chromium.org

unread,
Feb 1, 2018, 10:25:25 AM2/1/18
to blink-dev

Primary eng (and PM) emails

smcg...@chromium.org, fla...@chromium.org


Summary

Web Animations is a set of un-shipped web features (in all browsers), hidden behind --enable-blink-features=WebAnimationsAPI in Chrome. CompositeOperation is an enum defined by the spec and used in various places, with three values: 'replace', 'add', and 'accumulate'. Chrome today supports only 'replace' in stable, or 'replace' and 'add' when WebAnimationsAPI is enabled. Unfortunately Chrome also has a mixture of behaviors where in some situations it will accept 'add'/'accumulate' and silently turn them into 'replace', and in some situations it will throw a NotSupportedException upon seeing 'add'/'accumulate'. We plan to consolidate this behavior to always silently fallback to 'replace' when an unsupported (but valid) value is specified.


Motivation

This aligns Chrome with other browsers (Firefox), and allows developers to remove Chrome-specific workarounds.


Interoperability and Compatibility Risk

Low. To be clear, no behavior that is currently visible in Chrome stable will change. The only places that Chrome currently throws (and we wish to change) require the developer to be running with --enable-blink-features=WebAnimationsAPI (or --enable-blink-features=CSSAdditiveAnimations, which is a related flag).


Edge: Unknown.

Firefox: Supported; Firefox does not throw for valid composite values even when it doesn't implement them.

Safari: Unknown.


Alternative implementation suggestion for web developers

As in Firefox today, developers will be able to test for what composite value is being used as follows:


const anim = target.animate(keyframes, { composite: 'accumulate' });

if (!anim.effect) {

// No KeyframeEffect exposed; composite mode will be 'replace'.

} else {

// Will return the composite mode being used.

console.log(anim.effect.composite);

}


Similar APIs exist for other places that CompositeOperation is used.

Usage information from UseCounter

No UseCounter implemented.


OWP launch tracking bug

http://crbug.com/806139 (note that this bug got conflated with a separate bug relating to Chrome stable, so it's a bit of a confusing read).


Entry on the feature dashboard

No entry. Change is believed to be too small to merit one.


smcg...@chromium.org

unread,
Feb 1, 2018, 10:26:42 AM2/1/18
to blink-dev
Forget to include removal plan:

Intent is to remove support immediately (M66) with no prior deprecation, given that this is all behind feature flags that are not on in stable.

Rick Byers

unread,
Feb 2, 2018, 4:29:57 PM2/2/18
to smcg...@chromium.org, blink-dev
No LGTM is necessary for changes behind a flag (that's the beauty of working behind a flag until ready to ship 😉).

To clarify the flag though, core WebAnim v1 is shipped, there's just additional v2 APIs (like this) that are still experimental, right?  I think I remember Shane saying v2 was on hold until there was more adoption of v1.  With WebKits implementation well underway, hopefully we'll soon be able to say Edge is the only place WebAnim is missing.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d91185ae-23ec-4bbd-99a9-ed5d67cf520f%40chromium.org.

smcg...@chromium.org

unread,
Feb 2, 2018, 10:41:13 PM2/2/18
to blink-dev, smcg...@chromium.org
Ok, so what has happened here is that I misunderstood the extent of the change we were making (which explains why I was initially confused why flackr@ wanted to sent an intent to deprecate & remove). We will be making change in stable-shipping APIs. Please disregard this intent, and I will send a new one with a correct contents early next week.

As to your question on the flag: currently Firefox stable and Chrome stable ship what I would (unofficially) call 'Web Animations v0'. (I am unsure if there is an official term). This consists of the 'element.animate(...)' API, a partial version of the 'Animation' interface, and not much else. Firefox nightly and Chrome with experimental flags both mostly* implement Web Animations v1, which is the full spec described in https://drafts.csswg.org/web-animations-1/. Web Animations v2, as you said, is early stages (https://drafts.csswg.org/web-animations-2/).

* Firefox has near complete support, Chrome is further behind.
Reply all
Reply to author
Forward
0 new messages