Re: [csswg-drafts] [css-animations] Resolving dependencies in keyframes (#5125)

> PS: I realize this topic has been discussed many times before, and I apologize for not digging up all prior discussion in advance. (Please add links). At the same time, I hope we can avoid treating prior resolutions as automatically holy and immutable, since they apparently failed (so far) to effectuate any real consensus in browser behavior.

This is my fault because I went to make the spec edits but didn't want to make them without adding WPT. When I went to add WPT I realized how poor the existing WPT were and started rewriting them but didn't finish before I left Mozilla.

(Also now that I've lost access to my old Mozilla mail I can't find the different mails where I summarized the discussion so far 😅)

A couple of starter links though:
* Original outline of approaches: https://lists.w3.org/Archives/Public/www-style/2014Aug/0132.html
* Re-visiting and committing to that resolution in Sapporo F2F 2015: https://lists.w3.org/Archives/Public/www-style/2015Nov/0308.html

As for Firefox's behavior, it's definitely a known problem. We have put off fixing it a number of times thinking that we would fix it properly when we implement the Properties and Values API. Unfortunately we've had two incomplete attempts at that.

At this stage, since I don't have experience with Properties and Values and am less involved in implementation these days I suspect @emilio or @hiikezoe or @BorisChiou might be better able to comment.

> Note that getKeyframes in this model should in my opinion not return the keyframes as if "all property values are replaced with their computed values" as the spec currently suggest, as this would misrepresent the endpoints of the interpolation.

I'm sorry, I haven't given your proposal proper thought (Friday afternoon here after a tough week) but one comment here is that I suspect we need to stick to returning computed keyframes from `getKeyfarmes()` for CSS animations.

The reason is that it's simply not possible to represent specified CSS keyframes accurately using Javascript objects. There are all sorts of edge cases (e.g. declaration order matters in CSS, but not in JS; CSS can have duplicate declarations but JS can't) so you end up needing to expand shorthands etc. in order to correctly represent the the CSS markup -- and that in turn means you end up needing to compute values (since you need to know how variables are going to expand).

I really tried hard to preserve specified values in the CSS animation keyframes from `getKeyframes()` but it proved impossible and when I spoke with @graouts and @flackr they agreed we should just use the computed values.

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5125#issuecomment-635797449 using your GitHub account

Received on Friday, 29 May 2020 06:57:39 UTC