Re: [csswg-drafts] [css-animations-2] Consider not generating a CSSAnimation with null timeline (#7364)

> Option 1:
> 
> 1. Set `animation-timeline: none` initially -> No CSSAnimation is generated
> 2. Set `animation-timeline: unknown-timeline` initially -> No CSSAnimation is generated
> 3. Change `animation-timeline` from a valid timeline to `none` -> The existing CSSAnimation is cancelled.
> 4. Change `animation-timeline` from a valid timeline to an unknown-timeline -> The existing CSSAnimation is cancelled.
> 
> Option 2: The alternative is to always generate a `CSSAnimation` and set the timeline to null when `animation-timeline` is `none` or some unknown-timeline and follow the procedure for setting a timeline to null defined in [[web-animations-2]](https://drafts.csswg.org/web-animations/#setting-the-timeline).

Thanks Boris for this great summary. I was thinking over this problem again this morning and I think I overlooked something.

I'm afraid I'm unfamiliar with how scroll animations are expected to be used, but **do we expect authors to update the computed style of `animation-timeline` such that the progress is preserved?**

If so, I think option 2 would be preferred.

Presumably, in that case, when `animation-timeline` is updated from one valid timeline to another (including `auto`), we would end up running the procedure to [_set the timeline of an animation_](https://drafts.csswg.org/web-animations/#set-the-timeline-of-an-animation).

In order to be consistent, when setting the timeline to `none` or some unknown timeline, we should probably also run that same procedure.

That would suggest that having a non-null timeline is _not_ a prerequisite for generating a `CSSAnimation` object.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 15 June 2022 00:41:01 UTC