Skip to content

Include synchronous steps in procedural algorithms #644

@ddorwin

Description

@ddorwin

The spec currently uses the following pattern:

When the requestSession(mode) method is invoked, the user agent MUST return a new Promise promise and run the following steps in parallel:

The examples in the TAG's Promises Guide (https://www.w3.org/2001/tag/doc/promises-guide#async-algorithms) use a different pattern where the creation and returning of the promise are in the numbered steps.

In addition to being consistent with this guide and, presumably, other specs, this pattern helps avoid/address issues like #643.

https://w3c.github.io/encrypted-media/#dom-mediakeysession-generaterequest is one such example and includes synchronous checks of state similar to those in #643.

Metadata

Metadata

Assignees

Labels

fixed by pending PRA PR that is in review will resolve this issue.help wantedThis is a good issue for anyone to pick up and work on filing a PR for.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions