Closed Bug 1469758 Opened 6 years ago Closed 6 years ago

Make Animation's async methods return promises

Categories

(Core :: DOM: Animation, enhancement, P2)

enhancement

Tracking

()

RESOLVED INVALID
Tracking Status
firefox62 --- affected

People

(Reporter: birtles, Assigned: birtles)

Details

The following spec change makes play(), pause(), reverse(), and updatePlaybackRate() on the Animation interface return Promise objects:

  https://github.com/w3c/csswg-drafts/commit/da4b58542c90bd61ac60342afa8dfaed2418f7ad

We should update this and ship the ready and finished promises at the same time because:

* From a feature-detection point-of-view it makes sense to ship these together
* We cannot pref-off changes in return value to WebIDL, especially not when the change is to a Promise type (as confirmed with bz last week)
* The ready/finished Promises are stable and very useful (we even polyfill it internally when we cannot use it, see bug 1449532)

I'll file a separate bug for preffing-on the ready/finished members and a suitable intent to ship for those.
I've implemented this:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a69d5c0c7ae9db920ed5220500f29e9a7c82c89c

However, I'm concerned about the implications of returning Promises that may reject if the animation is canceled causing "Unhandled Promise rejection" errors that are noisy and make the API more difficult to use.

I'll follow up on the spec issue: https://github.com/w3c/csswg-drafts/issues/2206
Priority: -- → P2
This change has been backed out of the spec:

https://github.com/w3c/csswg-drafts/commit/5253a665bc2597b2a0efdb287671439d06024d9e
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.