[encrypted-media] Ensure promises returned by methods are fulfilled before event handlers are executed

ddorwin has just created a new issue for
https://github.com/w3c/encrypted-media:

== Ensure promises returned by methods are fulfilled before event
handlers are executed ==
[This issue is broken out from the second comment in #14.]

The intended behavior, at least for `generateRequest()` and `load()`
is that the promise will be resolved (`.then()` statements run) before
events handlers for events fired by the algorithm run. This is what
authors are likely to expect. As an example, an author might want to
do something - possibly related to the new `sessionId` - when the
`generateRequest()` promise is resolved and ensure that this happens
_before_ the `message` event handler runs. The current spec text makes
no such guarantee. This issue tracks ensuring the intended order.

This issue takes priority over and thus blocks #14.

See https://github.com/w3c/encrypted-media/issues/19

Received on Tuesday, 20 January 2015 22:03:28 UTC