w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.

Home Page:https://w3c.github.io/webcodecs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Under what conditions should the ImageDecoder [[completed promise]] and ImageTrackList [[ready promise]] be rejected?

aosmond opened this issue · comments

The specification doesn't ever describe when we should reject ImageDecoder [[completed promise]] and ImageTrackList [[ready promise]].

We have tests that suggest that they should be rejected:
https://github.com/web-platform-tests/wpt/blob/53a1437dcfc754a3dc8ffe0bd34f9a6524e49fcf/webcodecs/image-decoder.https.any.js#L484
https://github.com/web-platform-tests/wpt/blob/53a1437dcfc754a3dc8ffe0bd34f9a6524e49fcf/webcodecs/image-decoder.https.any.js#L171

Also, I created the promises at ImageDecoder initialization. Filling in the gaps with tests meant rejecting both promises in these error cases, but that meant the WPT harness reported uncaught exceptions for the promise that wasn't checked in the test. Should we be creating the promises on demand when the JS caller first calls the getter?

Thanks for filing!

I'll put together some PRs to add these steps.

I'm not sure what you mean about creating the promises. We do create them at construction in Chromium.

Thanks for filing!

* `completed` should be rejected if https://w3c.github.io/webcodecs/#imagedecoder-close-imagedecoder is run and it hasn't been resolved.

* `ready` should be rejected by failed decodes and if https://w3c.github.io/webcodecs/#imagedecoder-close-imagedecoder is run and it hasn't been resolved.

I'll put together some PRs to add these steps.

Awesome thank you!

I'm not sure what you mean about creating the promises. We do create them at construction in Chromium.

Does Chromium get uncaught exception errors in the WPT harness when running the tests I referenced? The only obvious ways to silence them for me in Firefox was to either update the meta INI files, or to alter the test to make sure all of the promises reject with the expected result.