Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
editorial: Simplify the "obtain permission" algorithm.
Conceptually, the steps remain the same: 1. Return "granted" or "denied" if the permission state is set to either value. 2. Otherwise, return "denied" if there is no user activation. 3. Call the "request permission to use" algorithm from the Permissions spec in case there is user activation. The difference is that we now do it in 4 steps rather than 10 by 1) using the shorthands provided by the Permissions spec that allow us to use a PermissionName rather than having to create a PermissionDescriptor in the algorithms and 2) checking the "permission state" directly rather than invoking Permissions.query() and manipulating a promise. Ideally, we would remove this algorithm altogether in favor of the "request permission to use" algorithm from the Permissions spec, but we need to keep it in order to check for user activation in case we are in a "prompt" state (see the discussion in w3c#298). By not manipulating promises anymore, this incidentally fixes w3c#187.
- Loading branch information