W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2021

Re: [csswg-drafts] Web Animations Proposal: Add `Animation.started` and `Animation.playing` promises (#5871)

From: Brian Birtles via GitHub <sysbot+gh@w3.org>
Date: Thu, 14 Jan 2021 00:18:52 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-759840750-1610583531-sysbot+gh@w3.org>
Thanks for filing this issue. I wonder if you could elaborate on the use cases for this?

I'm not sure that Promises are the right fit for this use case. The [Writing Promise-Using Specifications](https://www.w3.org/2001/tag/doc/promises-guide#when-to-use) document gives some guidance about when to use Promises vs events.

In this case a start event can happen many times because:

* The playback rate can change back and forth meaning we enter the active interval from either end
* The current time can be seeked back and forth
* When we introduce nested effects, child effects can re-enter their active interval many times due to repetition or easing on an ancestor (perhaps even several thousand times per second in the case of a bounce easing effect).

So it would seem like events would be a better fit for this.

Regarding the third point above, it might also make sense to specify that such events only apply to the delay defined on the root effect, but then I believe authors will also want events on child effects and I don't know how we can fix that without introducing performance issues.

I believe we've seen similar proposals before so it might be worth searching for them and seeing what the concerns were then.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 14 January 2021 00:18:54 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:25 UTC