From 76dc60da7e30202195bb9ba107a90616797fd765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 8 May 2024 14:06:43 +1000 Subject: [PATCH] Editorial: use bikeshed shorthands in requestPermission() algorithm (#175) --- index.bs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/index.bs b/index.bs index c489e5d..f7dea09 100644 --- a/index.bs +++ b/index.bs @@ -517,25 +517,25 @@ The interval attribute must return
The requestPermission() method steps are: - 1. Let global be the current global object. - 1. Let hasTransientActivation be true if this's relevant global object has transient activation, and false otherwise. - 1. Let result be a new promise in this's relevant Realm. + 1. Let |global| be the [=current global object=]. + 1. Let |hasTransientActivation| be true if [=this=]'s [=relevant global object=] has [=transient activation=], and false otherwise. + 1. Let |result| be [=a new promise=] in [=this=]'s [=relevant Realm=]. 1. Run these steps in parallel: - 1. Let permissions be « "accelerometer", "gyroscope" ». - 1. For each name of permissions: - 1. If name's permission state is "{{PermissionState/prompt}}" and hasTransientActivation is false: - 1. Queue a global task on the device motion and orientation task source given global to reject result with a "{{NotAllowedError}}" {{DOMException}}. + 1. Let |permissions| be « "accelerometer", "gyroscope" ». + 1. [=list/For each=] |name| of |permissions|: + 1. If |name|'s permission state is "{{PermissionState/prompt}}" and |hasTransientActivation| is false: + 1. [=Queue a global task=] on the [=device motion and orientation task source=] given |global| to [=reject=] |result| with a "{{NotAllowedError}}" {{DOMException}}. 1. Return. - 1. Let permissionState be "{{PermissionState/granted}}". - 1. For each name of permissions: + 1. Let |permissionState| be "{{PermissionState/granted}}". + 1. [=list/For each=] |name| of |permissions|: Note: There is no algorithm for requesting multiple permissions at once. However, user agents are encouraged to bundle concurrent requests for different kinds of media into a single user-facing permission prompt. - 1. If the result of requesting permission to use name is not "{{PermissionState/granted}}": - 1. Set permissionState to "{{PermissionState/denied}}". - 1. Break - 1. Queue a global task on the device motion and orientation task source given global to resolve result with permissionState. - 1. Return result. + 1. If the result of requesting permission to use |name| is not "{{PermissionState/granted}}": + 1. Set |permissionState| to "{{PermissionState/denied}}". + 1. [=Break=]. + 1. [=Queue a global task=] on the [=device motion and orientation task source=] given |global| to [=resolve=] |result| with |permissionState|. + 1. Return |result|.