From 37f978103677f1fc0605729e61979730d39d3739 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Mon, 6 Nov 2023 11:26:27 +0100 Subject: [PATCH 01/28] Introduce Browser Permissions for WebDriver BiDi Based-on: https://github.com/w3c/webdriver-bidi/pull/590 Bug: #424 Bug: https://github.com/w3c/webdriver-bidi/issues/587 --- index.html | 374 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 280 insertions(+), 94 deletions(-) diff --git a/index.html b/index.html index 6fbe783..a6ec398 100644 --- a/index.html +++ b/index.html @@ -1177,14 +1177,14 @@

permission=] or by some user agent policy.

-
+

Automated testing

For the purposes of user-agent automation and application testing, this document defines - the following extension commands for the [[WebDriver]] specification. It is OPTIONAL - for a user agent to support extension commands commands. + extensions to the [[WebDriver]] and [[WebDriver-BiDi]] specifications. + It is OPTIONAL for a user agent to support them.

         dictionary PermissionSetParameters {
@@ -1192,104 +1192,290 @@ 

required PermissionState state; };

-
-

- Set Permission +
+

+ Automated testing with [[WebDriver-BiDi]]

- - - - - - - - - - - -
- HTTP Method - - URI Template -
- POST - - /session/{session id}/permissions -

- The Set Permission - extension command simulates user modification of a {{PermissionDescriptor}}'s - permission state. + This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification.

+
+

+ The browser Module +

+

+ The [=modules/browser=] module contains commands for + managing the remote end browser process. +

+
+
+ Definition +
+

+ [=remote end definition=] +

+
+              BrowserCommand = (
+                browser.setPermission
+              )
+            
+
+
+
+ Types +
+
+
+ The browser.PermissionDescriptor Type +
+
+                browser.PermissionDescriptor = {
+                  type: "permissionDescriptor",
+                  name: text,
+                }
+              
+

+ The browser.PermissionDescriptor type represents a {{PermissionDescriptor}}. +

+
+
+
+ The browser.PermissionState Type +
+
+                browser.PermissionState = "granted" / "denied" / "prompt"
+              
+

+ The browser.PermissionState type represents a {{PermissionState}}. +

+
+
+
+
+ Commands +
+
+
+ The browser.setPermission Command +
+

+ The Set Permission + [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s + [=permission state=]. +

+
+
Command Type
+
+
+                    browser.setPermission = (
+                      method: "browser.setPermission",
+                      params: browser.SetPermissionParameters
+                    )
+
+                    browser.SetPermissionParameters = {
+                      descriptor: browser.PermissionDescriptor,
+                      state: browser.PermissionState,
+                      ? context: browsingContext.BrowsingContext,
+                      ? origin: text,
+                    }
+                  
+
+
Result Type
+
+
+                    EmptyResult
+                  
+
+
+
+

+ The [=remote end steps=] with |session| and |command parameters| are: +

+
    +
  1. + Let |descriptor| be the value of the descriptor field of + |command parameters|. +
  2. +
  3. + Let |state| be the value of the state field of |command + parameters|. +
  4. +
  5. + Let |context id| be the value of the context field of + |command parameters|. +
  6. +
  7. + If |context id| is not present, let |context| be the [=top-level browsing context=] + of |session|. Otherwise, let |context| be the result of [=trying=] to + [=get a browsing context=] with |context id|. +
  8. +
  9. + Let |permission name| be the value of the name field of + |descriptor| representing {{PermissionDescriptor/name}}. +
  10. +
  11. + [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. + If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. +
  12. +
  13. + Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL + value of |permission name|'s [=powerful + feature/permission descriptor type=]. If this throws an exception, + return [=error=] with [=error code=] [=invalid argument=]. +
  14. +
  15. + If |state| is an inappropriate [=permission state=] for any + implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. +
  16. +
  17. + Let |settings| be the [=current settings object=]. +
  18. +
  19. + Let |targets| be a [=/list=] containing all [=environment settings object=] + whose [=environment settings object/origin=] is the same as + the [=environment settings object/origin=] of |settings|. +
  20. +
  21. + Let |tasks| be an empty [=/list=]. +
  22. +
  23. + For each [=environment settings object=] |target| in |targets|: +
  24. +
      +
    1. + [=Queue a task=] |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
    2. +
        +
      1. + Interpret |state| as if it were the result of an invocation of [=permission state=] + for |typedDescriptor| with the argument |target| made at this moment. +
      2. +
      +
    3. + [=list/Append=] |task| to |tasks|. +
    4. +
    +
  25. + Wait for all tasks in |tasks| to have executed. +
  26. +
  27. + Return [=success=] with data null. +
  28. +
+ +
+
+
+
+
+
+

+ Automated testing with [[WebDriver]] +

- The remote end steps are: + This document defines the following extension commands for the [[WebDriver]] specification.

-
    -
  1. Let |parameters| be the |parameters| argument, converted to an IDL value of - type {{PermissionSetParameters}}. If this throws an exception, return an [=invalid - argument=] [=error=]. -
  2. -
  3. Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}. -
  4. -
  5. Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL - value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful - feature/permission descriptor type=]. If this throws an exception, return a [=invalid - argument=] [=error=]. -
  6. -
  7. If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission - state for any implementation-defined reason, return a [=invalid argument=] [=error=]. -

    - For example, user agents that define the "midi" powerful feature as - "always on" may choose to reject a command to set the permission state to - {{PermissionState/"denied"}} at this step. -

    -
  8. -
  9. Let |settings| be the [=current settings object=]. -
  10. -
  11. Let |targets| be a list containing all environment settings objects - whose [=environment settings object/origin=] is the same as - the [=environment settings object/origin=] of |settings|. -
  12. -
  13. Let |tasks| be an empty list. -
  14. -
  15. For each environment settings object |target| in |targets|: -
      -
    1. - Queue a task |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
        -
      1. Interpret |parameters|.{{PermissionSetParameters/state}} as if it were the - result of an invocation of permission state for |typedDescriptor| with the - argument |target| made at this moment. -
      2. -
      -
    2. -
    3. [=list/Append=] |task| to |tasks|. -
    4. -
    -
  16. -
  17. Wait for all tasks in |tasks| to have executed. -
  18. -
  19. Return success with data `null`. -
  20. -
- +

+ The remote end steps are: +

+
    +
  1. Let |parameters| be the |parameters| argument, converted to an IDL value of + type {{PermissionSetParameters}}. If this throws an exception, return an [=invalid + argument=] [=error=]. +
  2. +
  3. Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}. +
  4. +
  5. Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL + value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful + feature/permission descriptor type=]. If this throws an exception, return a [=invalid + argument=] [=error=]. +
  6. +
  7. If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission + state for any implementation-defined reason, return a [=invalid argument=] [=error=]. +

    + For example, user agents that define the "midi" powerful feature as + "always on" may choose to reject a command to set the permission state to + {{PermissionState/"denied"}} at this step. +

    +
  8. +
  9. Let |settings| be the [=current settings object=]. +
  10. +
  11. Let |targets| be a list containing all environment settings objects + whose [=environment settings object/origin=] is the same as + the [=environment settings object/origin=] of |settings|. +
  12. +
  13. Let |tasks| be an empty list. +
  14. +
  15. For each environment settings object |target| in |targets|: +
      +
    1. + Queue a task |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
        +
      1. Interpret |parameters|.{{PermissionSetParameters/state}} as if it were the + result of an invocation of permission state for |typedDescriptor| with the + argument |target| made at this moment. +
      2. +
      +
    2. +
    3. [=list/Append=] |task| to |tasks|. +
    4. +
    +
  16. +
  17. Wait for all tasks in |tasks| to have executed. +
  18. +
  19. Return success with data `null`. +
  20. +
+ +

From 437ba0bab1c35cd66048b32e865b72470cdb294b Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 9 Nov 2023 16:26:57 +0100 Subject: [PATCH 02/28] reorder: webdriver classic to come before bidi --- index.html | 357 +++++++++++++++++++++++++++-------------------------- 1 file changed, 179 insertions(+), 178 deletions(-) diff --git a/index.html b/index.html index a6ec398..d2840b2 100644 --- a/index.html +++ b/index.html @@ -1192,184 +1192,6 @@

required PermissionState state; }; -
-

- Automated testing with [[WebDriver-BiDi]] -

-

- This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification. -

-
-

- The browser Module -

-

- The [=modules/browser=] module contains commands for - managing the remote end browser process. -

-
-
- Definition -
-

- [=remote end definition=] -

-
-              BrowserCommand = (
-                browser.setPermission
-              )
-            
-
-
-
- Types -
-
-
- The browser.PermissionDescriptor Type -
-
-                browser.PermissionDescriptor = {
-                  type: "permissionDescriptor",
-                  name: text,
-                }
-              
-

- The browser.PermissionDescriptor type represents a {{PermissionDescriptor}}. -

-
-
-
- The browser.PermissionState Type -
-
-                browser.PermissionState = "granted" / "denied" / "prompt"
-              
-

- The browser.PermissionState type represents a {{PermissionState}}. -

-
-
-
-
- Commands -
-
-
- The browser.setPermission Command -
-

- The Set Permission - [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s - [=permission state=]. -

-
-
Command Type
-
-
-                    browser.setPermission = (
-                      method: "browser.setPermission",
-                      params: browser.SetPermissionParameters
-                    )
-
-                    browser.SetPermissionParameters = {
-                      descriptor: browser.PermissionDescriptor,
-                      state: browser.PermissionState,
-                      ? context: browsingContext.BrowsingContext,
-                      ? origin: text,
-                    }
-                  
-
-
Result Type
-
-
-                    EmptyResult
-                  
-
-
-
-

- The [=remote end steps=] with |session| and |command parameters| are: -

-
    -
  1. - Let |descriptor| be the value of the descriptor field of - |command parameters|. -
  2. -
  3. - Let |state| be the value of the state field of |command - parameters|. -
  4. -
  5. - Let |context id| be the value of the context field of - |command parameters|. -
  6. -
  7. - If |context id| is not present, let |context| be the [=top-level browsing context=] - of |session|. Otherwise, let |context| be the result of [=trying=] to - [=get a browsing context=] with |context id|. -
  8. -
  9. - Let |permission name| be the value of the name field of - |descriptor| representing {{PermissionDescriptor/name}}. -
  10. -
  11. - [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. - If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. -
  12. -
  13. - Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL - value of |permission name|'s [=powerful - feature/permission descriptor type=]. If this throws an exception, - return [=error=] with [=error code=] [=invalid argument=]. -
  14. -
  15. - If |state| is an inappropriate [=permission state=] for any - implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. -
  16. -
  17. - Let |settings| be the [=current settings object=]. -
  18. -
  19. - Let |targets| be a [=/list=] containing all [=environment settings object=] - whose [=environment settings object/origin=] is the same as - the [=environment settings object/origin=] of |settings|. -
  20. -
  21. - Let |tasks| be an empty [=/list=]. -
  22. -
  23. - For each [=environment settings object=] |target| in |targets|: -
  24. -
      -
    1. - [=Queue a task=] |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
    2. -
        -
      1. - Interpret |state| as if it were the result of an invocation of [=permission state=] - for |typedDescriptor| with the argument |target| made at this moment. -
      2. -
      -
    3. - [=list/Append=] |task| to |tasks|. -
    4. -
    -
  25. - Wait for all tasks in |tasks| to have executed. -
  26. -
  27. - Return [=success=] with data null. -
  28. -
- -
-
-
-
-

Automated testing with [[WebDriver]] @@ -1478,6 +1300,185 @@

+
+

+ Automated testing with [[WebDriver-BiDi]] +

+

+ This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification. +

+
+

+ The browser Module +

+

+ The [=modules/browser=] module contains commands for + managing the remote end browser process. +

+
+
+ Definition +
+

+ [=remote end definition=] +

+
+            BrowserCommand = (
+              browser.setPermission
+            )
+          
+
+
+
+ Types +
+
+
+ The browser.PermissionDescriptor Type +
+
+              browser.PermissionDescriptor = {
+                type: "permissionDescriptor",
+                name: text,
+              }
+            
+

+ The browser.PermissionDescriptor type represents a {{PermissionDescriptor}}. +

+
+
+
+ The browser.PermissionState Type +
+
+              browser.PermissionState = "granted" / "denied" / "prompt"
+            
+

+ The browser.PermissionState type represents a {{PermissionState}}. +

+
+
+
+
+ Commands +
+
+
+ The browser.setPermission Command +
+

+ The Set Permission + [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s + [=permission state=]. +

+
+
Command Type
+
+
+                  browser.setPermission = (
+                    method: "browser.setPermission",
+                    params: browser.SetPermissionParameters
+                  )
+
+                  browser.SetPermissionParameters = {
+                    descriptor: browser.PermissionDescriptor,
+                    state: browser.PermissionState,
+                    ? context: browsingContext.BrowsingContext,
+                    ? origin: text,
+                  }
+                
+
+
Result Type
+
+
+                  EmptyResult
+                
+
+
+
+

+ The [=remote end steps=] with |session| and |command parameters| are: +

+
    +
  1. + Let |descriptor| be the value of the descriptor field of + |command parameters|. +
  2. +
  3. + Let |state| be the value of the state field of |command + parameters|. +
  4. +
  5. + Let |context id| be the value of the context field of + |command parameters|. +
  6. +
  7. + If |context id| is not present, let |context| be the [=top-level browsing context=] + of |session|. Otherwise, let |context| be the result of [=trying=] to + [=get a browsing context=] with |context id|. +
  8. +
  9. + Let |permission name| be the value of the name field of + |descriptor| representing {{PermissionDescriptor/name}}. +
  10. +
  11. + + [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. + If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. +
  12. +
  13. + Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL + value of |permission name|'s [=powerful + feature/permission descriptor type=]. If this throws an exception, + return [=error=] with [=error code=] [=invalid argument=]. +
  14. +
  15. + If |state| is an inappropriate [=permission state=] for any + implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. +
  16. +
  17. + Let |settings| be the [=current settings object=]. +
  18. +
  19. + Let |targets| be a [=/list=] containing all [=environment settings object=] + whose [=environment settings object/origin=] is the same as + the [=environment settings object/origin=] of |settings|. +
  20. +
  21. + Let |tasks| be an empty [=/list=]. +
  22. +
  23. + For each [=environment settings object=] |target| in |targets|: +
  24. +
      +
    1. + [=Queue a task=] |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
    2. +
        +
      1. + Interpret |state| as if it were the result of an invocation of [=permission state=] + for |typedDescriptor| with the argument |target| made at this moment. +
      2. +
      +
    3. + [=list/Append=] |task| to |tasks|. +
    4. +
    +
  25. + Wait for all tasks in |tasks| to have executed. +
  26. +
  27. + Return [=success=] with data null. +
  28. +
+ +
+
+
+
+

Privacy considerations From d7310e375d0e9078dbe807568d23931dd8de2f8c Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 9 Nov 2023 16:32:57 +0100 Subject: [PATCH 03/28] rename browser -> permissions module --- index.html | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index d2840b2..89021fb 100644 --- a/index.html +++ b/index.html @@ -1308,63 +1308,63 @@

This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification.

-

- The browser Module +

+ The permissions Module

- The [=modules/browser=] module contains commands for - managing the remote end browser process. + The permissions module contains commands for + managing the remote end browser permissions.

-
+
Definition

[=remote end definition=]

-            BrowserCommand = (
-              browser.setPermission
+            PermissionsCommand = (
+              permissions.setPermission
             )
           
-
+
Types
-
- The browser.PermissionDescriptor Type +
+ The permissions.PermissionDescriptor Type
-              browser.PermissionDescriptor = {
+              permissions.PermissionDescriptor = {
                 type: "permissionDescriptor",
                 name: text,
               }
             

- The browser.PermissionDescriptor type represents a {{PermissionDescriptor}}. + The permissions.PermissionDescriptor type represents a {{PermissionDescriptor}}.

-
- The browser.PermissionState Type +
+ The permissions.PermissionState Type
-              browser.PermissionState = "granted" / "denied" / "prompt"
+              permissions.PermissionState = "granted" / "denied" / "prompt"
             

- The browser.PermissionState type represents a {{PermissionState}}. + The permissions.PermissionState type represents a {{PermissionState}}.

-
+
Commands
-
- The browser.setPermission Command +
+ The permissions.setPermission Command

The Set Permission @@ -1375,14 +1375,14 @@

Command Type
-                  browser.setPermission = (
-                    method: "browser.setPermission",
-                    params: browser.SetPermissionParameters
+                  permissions.setPermission = (
+                    method: "permissions.setPermission",
+                    params: permissions.SetPermissionParameters
                   )
 
-                  browser.SetPermissionParameters = {
-                    descriptor: browser.PermissionDescriptor,
-                    state: browser.PermissionState,
+                  permissions.SetPermissionParameters = {
+                    descriptor: permissions.PermissionDescriptor,
+                    state: permissions.PermissionState,
                     ? context: browsingContext.BrowsingContext,
                     ? origin: text,
                   }

From 22c53fa06ae90cd5914b5b4cdc7e85e12e9b2904 Mon Sep 17 00:00:00 2001
From: Thiago Perrotta 
Date: Thu, 9 Nov 2023 16:34:09 +0100
Subject: [PATCH 04/28] fix 
nesting --- index.html | 318 ++++++++++++++++++++++++++--------------------------- 1 file changed, 159 insertions(+), 159 deletions(-) diff --git a/index.html b/index.html index 89021fb..b85b1a7 100644 --- a/index.html +++ b/index.html @@ -1299,182 +1299,182 @@

-
-
-

- Automated testing with [[WebDriver-BiDi]] -

-

- This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification. -

-
-

- The permissions Module -

+
+

+ Automated testing with [[WebDriver-BiDi]] +

- The permissions module contains commands for - managing the remote end browser permissions. + This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification.

-
- Definition -
+

+ The permissions Module +

- [=remote end definition=] + The permissions module contains commands for + managing the remote end browser permissions.

-
-            PermissionsCommand = (
-              permissions.setPermission
-            )
-          
-
-
-
- Types -
-
- The permissions.PermissionDescriptor Type -
-
-              permissions.PermissionDescriptor = {
-                type: "permissionDescriptor",
-                name: text,
-              }
-            
+
+ Definition +

- The permissions.PermissionDescriptor type represents a {{PermissionDescriptor}}. + [=remote end definition=]

+
+              PermissionsCommand = (
+                permissions.setPermission
+              )
+            
-
- The permissions.PermissionState Type -
-
-              permissions.PermissionState = "granted" / "denied" / "prompt"
-            
-

- The permissions.PermissionState type represents a {{PermissionState}}. -

+
+ Types +
+
+
+ The permissions.PermissionDescriptor Type +
+
+                permissions.PermissionDescriptor = {
+                  type: "permissionDescriptor",
+                  name: text,
+                }
+              
+

+ The permissions.PermissionDescriptor type represents a {{PermissionDescriptor}}. +

+
+
+
+ The permissions.PermissionState Type +
+
+                permissions.PermissionState = "granted" / "denied" / "prompt"
+              
+

+ The permissions.PermissionState type represents a {{PermissionState}}. +

+
-
-
-
- Commands -
-
- The permissions.setPermission Command -
-

- The Set Permission - [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s - [=permission state=]. -

-
-
Command Type
-
-
-                  permissions.setPermission = (
-                    method: "permissions.setPermission",
-                    params: permissions.SetPermissionParameters
-                  )
+            
+ Commands +
+
+
+ The permissions.setPermission Command +
+

+ The Set Permission + [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s + [=permission state=]. +

+
+
Command Type
+
+
+                    permissions.setPermission = (
+                      method: "permissions.setPermission",
+                      params: permissions.SetPermissionParameters
+                    )
 
-                  permissions.SetPermissionParameters = {
-                    descriptor: permissions.PermissionDescriptor,
-                    state: permissions.PermissionState,
-                    ? context: browsingContext.BrowsingContext,
-                    ? origin: text,
-                  }
-                
-
-
Result Type
-
-
-                  EmptyResult
-                
-
-
-
-

- The [=remote end steps=] with |session| and |command parameters| are: -

-
    -
  1. - Let |descriptor| be the value of the descriptor field of - |command parameters|. -
  2. -
  3. - Let |state| be the value of the state field of |command - parameters|. -
  4. -
  5. - Let |context id| be the value of the context field of - |command parameters|. -
  6. -
  7. - If |context id| is not present, let |context| be the [=top-level browsing context=] - of |session|. Otherwise, let |context| be the result of [=trying=] to - [=get a browsing context=] with |context id|. -
  8. -
  9. - Let |permission name| be the value of the name field of - |descriptor| representing {{PermissionDescriptor/name}}. -
  10. -
  11. - - [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. - If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. -
  12. -
  13. - Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL - value of |permission name|'s [=powerful - feature/permission descriptor type=]. If this throws an exception, - return [=error=] with [=error code=] [=invalid argument=]. -
  14. -
  15. - If |state| is an inappropriate [=permission state=] for any - implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. -
  16. -
  17. - Let |settings| be the [=current settings object=]. -
  18. -
  19. - Let |targets| be a [=/list=] containing all [=environment settings object=] - whose [=environment settings object/origin=] is the same as - the [=environment settings object/origin=] of |settings|. -
  20. -
  21. - Let |tasks| be an empty [=/list=]. -
  22. -
  23. - For each [=environment settings object=] |target| in |targets|: -
  24. -
      -
    1. - [=Queue a task=] |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
    2. + permissions.SetPermissionParameters = { + descriptor: permissions.PermissionDescriptor, + state: permissions.PermissionState, + ? context: browsingContext.BrowsingContext, + ? origin: text, + } +
+
+
Result Type
+
+
+                    EmptyResult
+                  
+
+
+
+

+ The [=remote end steps=] with |session| and |command parameters| are: +

+
    +
  1. + Let |descriptor| be the value of the descriptor field of + |command parameters|. +
  2. +
  3. + Let |state| be the value of the state field of |command + parameters|. +
  4. +
  5. + Let |context id| be the value of the context field of + |command parameters|. +
  6. +
  7. + If |context id| is not present, let |context| be the [=top-level browsing context=] + of |session|. Otherwise, let |context| be the result of [=trying=] to + [=get a browsing context=] with |context id|. +
  8. +
  9. + Let |permission name| be the value of the name field of + |descriptor| representing {{PermissionDescriptor/name}}. +
  10. +
  11. + + [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. + If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. +
  12. +
  13. + Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL + value of |permission name|'s [=powerful + feature/permission descriptor type=]. If this throws an exception, + return [=error=] with [=error code=] [=invalid argument=]. +
  14. +
  15. + If |state| is an inappropriate [=permission state=] for any + implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. +
  16. +
  17. + Let |settings| be the [=current settings object=]. +
  18. +
  19. + Let |targets| be a [=/list=] containing all [=environment settings object=] + whose [=environment settings object/origin=] is the same as + the [=environment settings object/origin=] of |settings|. +
  20. +
  21. + Let |tasks| be an empty [=/list=]. +
  22. +
  23. + For each [=environment settings object=] |target| in |targets|: +
    1. - Interpret |state| as if it were the result of an invocation of [=permission state=] - for |typedDescriptor| with the argument |target| made at this moment. + [=Queue a task=] |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
    2. +
        +
      1. + Interpret |state| as if it were the result of an invocation of [=permission state=] + for |typedDescriptor| with the argument |target| made at this moment. +
      2. +
      +
    3. + [=list/Append=] |task| to |tasks|.
    -
  24. - [=list/Append=] |task| to |tasks|. -
  25. -
-
  • - Wait for all tasks in |tasks| to have executed. -
  • -
  • - Return [=success=] with data null. -
  • - - -
    +
  • + Wait for all tasks in |tasks| to have executed. +
  • +
  • + Return [=success=] with data null. +
  • + + + +
    From 49bec973dec1601b713602d16268d61c0a660d23 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 14 Nov 2023 22:32:57 +0100 Subject: [PATCH 05/28] remove user context / browsing context ID for now --- index.html | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index b85b1a7..714ff19 100644 --- a/index.html +++ b/index.html @@ -1382,7 +1382,6 @@
    permissions.SetPermissionParameters = { descriptor: permissions.PermissionDescriptor, state: permissions.PermissionState, - ? context: browsingContext.BrowsingContext, ? origin: text, } @@ -1406,30 +1405,15 @@
  • Let |state| be the value of the state field of |command parameters|. -
  • -
  • - Let |context id| be the value of the context field of - |command parameters|. -
  • -
  • - If |context id| is not present, let |context| be the [=top-level browsing context=] - of |session|. Otherwise, let |context| be the result of [=trying=] to - [=get a browsing context=] with |context id|.
  • Let |permission name| be the value of the name field of |descriptor| representing {{PermissionDescriptor/name}}.
  • - - [=Convert to an IDL value=] (|descriptor|, |state|) of type {{PermissionSetParameters}}. - If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. -
  • -
  • - Let |typedDescriptor| be the object |descriptor| refers to, converted to an IDL - value of |permission name|'s [=powerful - feature/permission descriptor type=]. If this throws an exception, - return [=error=] with [=error code=] [=invalid argument=]. + Let |typedDescriptor| be the object |descriptor| refers to, [=converted to an IDL value=] (|descriptor|, |state|) of + {{PermissionSetParameters}} |permission name|'s [=powerful feature/permission descriptor type=]. + If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
  • If |state| is an inappropriate [=permission state=] for any From 7c9e37b5d133dfbeac7a823c46e4b382e125406b Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 14 Nov 2023 22:36:01 +0100 Subject: [PATCH 06/28] consolidate TODOs --- index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 714ff19..e10da4d 100644 --- a/index.html +++ b/index.html @@ -1382,7 +1382,6 @@
    permissions.SetPermissionParameters = { descriptor: permissions.PermissionDescriptor, state: permissions.PermissionState, - ? origin: text, } @@ -1394,6 +1393,12 @@
    +

    + TODO: Add user context to SetPermissionParameters. +

    +

    + TODO: Add origin. +

    The [=remote end steps=] with |session| and |command parameters| are:

    @@ -1456,7 +1461,6 @@
    Return [=success=] with data null.
  • -
    From 5ffe92c790d9ac3b274da1f6268d43ab25c3d85a Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 14 Nov 2023 22:39:43 +0100 Subject: [PATCH 07/28] move items around --- index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index e10da4d..3e444d0 100644 --- a/index.html +++ b/index.html @@ -1238,11 +1238,6 @@

  • Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}.
  • -
  • Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL - value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful - feature/permission descriptor type=]. If this throws an exception, return a [=invalid - argument=] [=error=]. -
  • If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission state for any implementation-defined reason, return a [=invalid argument=] [=error=].

    @@ -1251,6 +1246,11 @@

    {{PermissionState/"denied"}} at this step.

  • +
  • Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL + value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful + feature/permission descriptor type=]. If this throws an exception, return a [=invalid + argument=] [=error=]. +
  • Let |settings| be the [=current settings object=].
  • Let |targets| be a list containing all environment settings objects @@ -1406,24 +1406,24 @@
  • Let |descriptor| be the value of the descriptor field of |command parameters|. +
  • +
  • + Let |permission name| be the value of the name field of + |descriptor| representing {{PermissionDescriptor/name}}.
  • Let |state| be the value of the state field of |command parameters|.
  • - Let |permission name| be the value of the name field of - |descriptor| representing {{PermissionDescriptor/name}}. + If |state| is an inappropriate [=permission state=] for any + implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=].
  • Let |typedDescriptor| be the object |descriptor| refers to, [=converted to an IDL value=] (|descriptor|, |state|) of {{PermissionSetParameters}} |permission name|'s [=powerful feature/permission descriptor type=]. If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
  • -
  • - If |state| is an inappropriate [=permission state=] for any - implementation-defined reason, return [=error=] with [=error code=] [=invalid argument=]. -
  • Let |settings| be the [=current settings object=].
  • From b9fed1f56919258401c3fe9fe3d7d3361a62e771 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 15 Nov 2023 16:18:23 +0100 Subject: [PATCH 08/28] indent --- index.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 3e444d0..0d4b7ff 100644 --- a/index.html +++ b/index.html @@ -1438,22 +1438,22 @@
  • For each [=environment settings object=] |target| in |targets|:
  • +
      +
    1. + [=Queue a task=] |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
      1. - [=Queue a task=] |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
      2. -
          -
        1. - Interpret |state| as if it were the result of an invocation of [=permission state=] - for |typedDescriptor| with the argument |target| made at this moment. -
        2. -
        -
      3. - [=list/Append=] |task| to |tasks|. + Interpret |state| as if it were the result of an invocation of [=permission state=] + for |typedDescriptor| with the argument |target| made at this moment.
      +
    2. + [=list/Append=] |task| to |tasks|. +
    3. +
  • Wait for all tasks in |tasks| to have executed.
  • From acf0653580d395214e477569ac6ff418b88b17d2 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 16 Nov 2023 13:25:22 +0100 Subject: [PATCH 09/28] introduce and use algorithm --- index.html | 90 ++++++++++++++++++++---------------------------------- 1 file changed, 33 insertions(+), 57 deletions(-) diff --git a/index.html b/index.html index 0d4b7ff..302cceb 100644 --- a/index.html +++ b/index.html @@ -1192,6 +1192,36 @@

    required PermissionState state; }; +

    To set a permission given descriptor, and state: +

      +
    1. Let |settings| be the [=current settings object=]. +
    2. +
    3. Let |targets| be a list containing all environment settings objects + whose [=environment settings object/origin=] is the same as + the [=environment settings object/origin=] of |settings|. +
    4. +
    5. Let |tasks| be an empty list. +
    6. +
    7. For each environment settings object |target| in |targets|: +
        +
      1. + Queue a task |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
          +
        1. Interpret |state| as if it were the + result of an invocation of permission state for |descriptor| with the + argument |target| made at this moment. +
        2. +
        +
      2. +
      3. [=list/Append=] |task| to |tasks|. +
      4. +
      +
    8. +
    9. Wait for all tasks in |tasks| to have executed. +
    10. +

    Automated testing with [[WebDriver]] @@ -1251,32 +1281,8 @@

    feature/permission descriptor type=]. If this throws an exception, return a [=invalid argument=] [=error=].

  • -
  • Let |settings| be the [=current settings object=]. -
  • -
  • Let |targets| be a list containing all environment settings objects - whose [=environment settings object/origin=] is the same as - the [=environment settings object/origin=] of |settings|. -
  • -
  • Let |tasks| be an empty list. -
  • -
  • For each environment settings object |target| in |targets|: -
      -
    1. - Queue a task |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
        -
      1. Interpret |parameters|.{{PermissionSetParameters/state}} as if it were the - result of an invocation of permission state for |typedDescriptor| with the - argument |target| made at this moment. -
      2. -
      -
    2. -
    3. [=list/Append=] |task| to |tasks|. -
    4. -
    -
  • -
  • Wait for all tasks in |tasks| to have executed. +
  • + Run the [=set a permission=] algorithm, passing |typedDescriptor| and |parameters|.{{PermissionSetParameters/state}}.
  • Return success with data `null`.
  • @@ -1425,37 +1431,7 @@

    If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
  • - Let |settings| be the [=current settings object=]. -
  • -
  • - Let |targets| be a [=/list=] containing all [=environment settings object=] - whose [=environment settings object/origin=] is the same as - the [=environment settings object/origin=] of |settings|. -
  • -
  • - Let |tasks| be an empty [=/list=]. -
  • -
  • - For each [=environment settings object=] |target| in |targets|: -
  • -
      -
    1. - [=Queue a task=] |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
    2. -
        -
      1. - Interpret |state| as if it were the result of an invocation of [=permission state=] - for |typedDescriptor| with the argument |target| made at this moment. -
      2. -
      -
    3. - [=list/Append=] |task| to |tasks|. -
    4. -
    -
  • - Wait for all tasks in |tasks| to have executed. + Run the [=set a permission=] algorithm, passing |typedDescriptor| and |state|.
  • Return [=success=] with data null. From 5e37655c6b14567a5ad87d886035ed6df2962251 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 16 Nov 2023 13:29:18 +0100 Subject: [PATCH 10/28] s/div/ol --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 302cceb..5765c71 100644 --- a/index.html +++ b/index.html @@ -1398,7 +1398,7 @@
    -
    +

      TODO: Add user context to SetPermissionParameters.

      @@ -1437,7 +1437,7 @@
      Return [=success=] with data null.
    -
    +
  • From 163fc86cfbf616317bee0f63a863f92c9763b34d Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 16 Nov 2023 14:15:19 +0100 Subject: [PATCH 11/28] s/run the set a permission/set a permission Co-authored-by: Alex Rudenko --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5765c71..52589a0 100644 --- a/index.html +++ b/index.html @@ -1282,7 +1282,7 @@

    argument=] [=error=].
  • - Run the [=set a permission=] algorithm, passing |typedDescriptor| and |parameters|.{{PermissionSetParameters/state}}. + [=Set a permission=] with |typedDescriptor| and |parameters|.{{PermissionSetParameters/state}}.
  • Return success with data `null`.
  • @@ -1431,7 +1431,7 @@

    If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
  • - Run the [=set a permission=] algorithm, passing |typedDescriptor| and |state|. + [=Set a permission=] with |typedDescriptor| and |state|.
  • Return [=success=] with data null. From 98dd229c87642e77e1989555476b67ebe2373716 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Thu, 16 Nov 2023 14:20:59 +0100 Subject: [PATCH 12/28] remove permissions.PermissionDescriptor.type --- index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/index.html b/index.html index 52589a0..ff1967c 100644 --- a/index.html +++ b/index.html @@ -1343,7 +1343,6 @@
                     permissions.PermissionDescriptor = {
    -                  type: "permissionDescriptor",
                       name: text,
                     }
                   
    From 12f450bc5f54cc5e72c00a8a6526ef9b3b77c9cd Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Sun, 19 Nov 2023 14:57:54 +0100 Subject: [PATCH 13/28] extension -> command, add code to TODOs --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index ff1967c..e28ad4f 100644 --- a/index.html +++ b/index.html @@ -1371,8 +1371,8 @@
    The permissions.setPermission Command

    - The Set Permission - [=extension module=] simulates user modification of a {{PermissionDescriptor}}'s + The Set Permission + [=command=] simulates user modification of a {{PermissionDescriptor}}'s [=permission state=].

    @@ -1399,10 +1399,10 @@

      - TODO: Add user context to SetPermissionParameters. + TODO: Add user context to SetPermissionParameters.

      - TODO: Add origin. + TODO: Add origin.

      The [=remote end steps=] with |session| and |command parameters| are: From afd657cc6c9ddd4ecc9dd5174cc005090635dab4 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 11:48:38 +0100 Subject: [PATCH 14/28] -> backticks --- index.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index e28ad4f..70cf40a 100644 --- a/index.html +++ b/index.html @@ -510,8 +510,8 @@

    @@ -1277,7 +1277,7 @@

  • Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL - value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful + value of `|rootDesc|.{{PermissionDescriptor/name}}`'s [=powerful feature/permission descriptor type=]. If this throws an exception, return a [=invalid argument=] [=error=].
  • @@ -1347,7 +1347,7 @@
    }

    - The permissions.PermissionDescriptor type represents a {{PermissionDescriptor}}. + The `permissions.PermissionDescriptor` type represents a {{PermissionDescriptor}}.

    @@ -1358,7 +1358,7 @@
    permissions.PermissionState = "granted" / "denied" / "prompt"

    - The permissions.PermissionState type represents a {{PermissionState}}. + The `permissions.PermissionState` type represents a {{PermissionState}}.

    @@ -1399,25 +1399,25 @@

      - TODO: Add user context to SetPermissionParameters. + TODO: Add user `context` to `SetPermissionParameters`.

      - TODO: Add origin. + TODO: Add `origin`.

      The [=remote end steps=] with |session| and |command parameters| are:

      1. - Let |descriptor| be the value of the descriptor field of + Let |descriptor| be the value of the `descriptor` field of |command parameters|.
      2. - Let |permission name| be the value of the name field of + Let |permission name| be the value of the `name` field of |descriptor| representing {{PermissionDescriptor/name}}.
      3. - Let |state| be the value of the state field of |command + Let |state| be the value of the `state` field of |command parameters|.
      4. From 0242b84839d77fa6aa847ef83290b0c84e37e45c Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 11:49:15 +0100 Subject: [PATCH 15/28] lang-json -> json --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 70cf40a..d7b0675 100644 --- a/index.html +++ b/index.html @@ -1293,7 +1293,7 @@

        [=current settings object=] of the session with ID 23 to "`granted`", the local end would POST to `/session/23/permissions` with the body:

        -
        +            
                     {
                       "descriptor": {
                         "name": "midi",
        
        From 67e7e63be6331f0e4aff3e30039f13804e71fcd7 Mon Sep 17 00:00:00 2001
        From: Thiago Perrotta 
        Date: Tue, 21 Nov 2023 11:49:56 +0100
        Subject: [PATCH 16/28] drop backticks from |rootDesc| name
        
        ---
         index.html | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/index.html b/index.html
        index d7b0675..918c50c 100644
        --- a/index.html
        +++ b/index.html
        @@ -1277,7 +1277,7 @@ 

      5. Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL - value of `|rootDesc|.{{PermissionDescriptor/name}}`'s [=powerful + value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful feature/permission descriptor type=]. If this throws an exception, return a [=invalid argument=] [=error=].
      6. From b97d2fb2c15da8a85adbb80d54bf9d3fe15d7eaa Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 11:50:26 +0100 Subject: [PATCH 17/28] may -> can --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 918c50c..678fa3d 100644 --- a/index.html +++ b/index.html @@ -1272,7 +1272,7 @@

        state for any implementation-defined reason, return a [=invalid argument=] [=error=].

        For example, user agents that define the "midi" powerful feature as - "always on" may choose to reject a command to set the permission state to + "always on" can choose to reject a command to set the permission state to {{PermissionState/"denied"}} at this step.

        From 4a5f3fd905d9c31212cf4e5cd56c5cd06f74532c Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 11:54:22 +0100 Subject: [PATCH 18/28] same origin --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 678fa3d..020858d 100644 --- a/index.html +++ b/index.html @@ -1197,7 +1197,7 @@

      7. Let |settings| be the [=current settings object=].
      8. Let |targets| be a list containing all environment settings objects - whose [=environment settings object/origin=] is the same as + whose [=environment settings object/origin=] is [=same origin=] as the [=environment settings object/origin=] of |settings|.
      9. Let |tasks| be an empty list. From edce1e0516cdbaf40cb1817a333afd433224f01b Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 11:55:02 +0100 Subject: [PATCH 19/28] environment settings objects -> [=environment settings objects=] --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 020858d..b53086a 100644 --- a/index.html +++ b/index.html @@ -1196,7 +1196,7 @@

        1. Let |settings| be the [=current settings object=].
        2. -
        3. Let |targets| be a list containing all environment settings objects +
        4. Let |targets| be a list containing all [=environment settings objects=] whose [=environment settings object/origin=] is [=same origin=] as the [=environment settings object/origin=] of |settings|.
        5. From c6eaf4ce26d56900bd4723cf55f73ae446fdeba6 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Tue, 21 Nov 2023 12:06:00 +0100 Subject: [PATCH 20/28] fix algorithm markup --- index.html | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index b53086a..a89e945 100644 --- a/index.html +++ b/index.html @@ -1194,14 +1194,12 @@

          To set a permission given descriptor, and state:

            -
          1. Let |settings| be the [=current settings object=]. -
          2. +
          3. Let |settings| be the [=current settings object=].
          4. Let |targets| be a list containing all [=environment settings objects=] whose [=environment settings object/origin=] is [=same origin=] as the [=environment settings object/origin=] of |settings|.
          5. -
          6. Let |tasks| be an empty list. -
          7. +
          8. Let |tasks| be an empty list.
          9. For each environment settings object |target| in |targets|:
            1. @@ -1215,12 +1213,10 @@

          10. -
          11. [=list/Append=] |task| to |tasks|. -
          12. +
          13. [=list/Append=] |task| to |tasks|.
          -
        6. Wait for all tasks in |tasks| to have executed. -
        7. +
        8. Wait for all tasks in |tasks| to have executed.

        @@ -1397,13 +1393,13 @@

        -
          -

          - TODO: Add user `context` to `SetPermissionParameters`. -

          -

          - TODO: Add `origin`. -

          +

          + TODO: Add `user context` to `SetPermissionParameters`. +

          +

          + TODO: Add `origin` to `SetPermissionParameters`. +

          +

          The [=remote end steps=] with |session| and |command parameters| are:

          @@ -1429,14 +1425,10 @@
          {{PermissionSetParameters}} |permission name|'s [=powerful feature/permission descriptor type=]. If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=]. -
        1. - [=Set a permission=] with |typedDescriptor| and |state|. -
        2. -
        3. - Return [=success=] with data null. -
        4. +
        5. [=Set a permission=] with |typedDescriptor| and |state|.
        6. +
        7. Return [=success=] with data null.
        -

      + From 5a18fe1fd0bb89157b6390e834411437e70a3d8e Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 11:47:30 +0100 Subject: [PATCH 21/28] remove TODOs: move them to #424 --- index.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/index.html b/index.html index a89e945..b8039c2 100644 --- a/index.html +++ b/index.html @@ -1393,12 +1393,6 @@
      -

      - TODO: Add `user context` to `SetPermissionParameters`. -

      -

      - TODO: Add `origin` to `SetPermissionParameters`. -

      The [=remote end steps=] with |session| and |command parameters| are: From 175f8168ecd533f415918125b0cb97f3aad5502e Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 11:49:13 +0100 Subject: [PATCH 22/28] algorithm: add 'and return' --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index b8039c2..122feb8 100644 --- a/index.html +++ b/index.html @@ -1216,7 +1216,7 @@

    1. [=list/Append=] |task| to |tasks|.
    -
  • Wait for all tasks in |tasks| to have executed.
  • +
  • Wait for all tasks in |tasks| to have executed and return.
  • From a8647fe398409836069586baf605532495605d24 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:33:24 +0100 Subject: [PATCH 23/28] rename all anchors to match the convention in the bidi spec --- index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 122feb8..9e2debc 100644 --- a/index.html +++ b/index.html @@ -1226,7 +1226,7 @@

    This document defines the following extension commands for the [[WebDriver]] specification.

    -

    +

    Set Permission

    @@ -1309,7 +1309,7 @@

    This document defines the following [=extension modules=] for the [[WebDriver-BiDi]] specification.

    -

    +

    The permissions Module

    @@ -1317,7 +1317,7 @@

    managing the remote end browser permissions.

    -
    +
    Definition

    @@ -1330,11 +1330,11 @@

    -
    +
    Types
    -
    +
    The permissions.PermissionDescriptor Type
    @@ -1347,7 +1347,7 @@ 

    -
    +
    The permissions.PermissionState Type
    @@ -1359,11 +1359,11 @@ 
    -
    +
    Commands
    -
    +
    The permissions.setPermission Command

    From fcd4cb2285b8863a6165ca995ccbab6e52395feb Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:38:53 +0100 Subject: [PATCH 24/28] null -> `null` --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 9e2debc..972d5c7 100644 --- a/index.html +++ b/index.html @@ -310,7 +310,7 @@

    [=permission store entry/descriptor=] is |descriptor|, and whose [=permission store entry/key=] [=permission key/is equal to=] |key| given |descriptor|, return that entry. -
  • Return null. +
  • Return `null`.
  • @@ -787,7 +787,7 @@

  • Let |entry| be the result of [=get a permission store entry|getting a permission store entry=] with |descriptor| and |key|.
  • -
  • If |entry| is not null, return a {{PermissionState}} enum value from |entry|'s +
  • If |entry| is not `null`, return a {{PermissionState}} enum value from |entry|'s [=permission store entry/state=].
  • Return the {{PermissionState}} enum value that represents the permission state of @@ -1101,7 +1101,7 @@

  • Let |document| be |status|'s [=relevant global object=]'s [=associated Document=].
  • -
  • If |document| is null or |document| is not [=Document/fully active=], terminate +
  • If |document| is `null` or |document| is not [=Document/fully active=], terminate this algorithm.
  • @@ -1420,7 +1420,7 @@

    If this conversion throws an exception, return [=error=] with [=error code=] [=invalid argument=].
  • [=Set a permission=] with |typedDescriptor| and |state|.
  • -
  • Return [=success=] with data null.
  • +
  • Return [=success=] with data `null`.
  • From edd94bc0de74dc2026c654eeaec78b6ffa1f19fd Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:41:59 +0100 Subject: [PATCH 25/28] augment algorithm paragraph with types --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 972d5c7..d7fd15d 100644 --- a/index.html +++ b/index.html @@ -1192,7 +1192,8 @@

    required PermissionState state; }; -

    To set a permission given descriptor, and state: + To set a permission given a {{PermissionDescriptor}} |descriptor:PermissionDescriptor|, and a {{PermissionState}} |state:PermissionState|: +

    1. Let |settings| be the [=current settings object=].
    2. Let |targets| be a list containing all [=environment settings objects=] From 2f2dfb25eaa47e2770015968f34e037b8b8c6dc8 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:49:50 +0100 Subject: [PATCH 26/28] fix algorithm variable highlighting --- index.html | 59 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index d7fd15d..172966d 100644 --- a/index.html +++ b/index.html @@ -1192,33 +1192,36 @@

      required PermissionState state; }; - To set a permission given a {{PermissionDescriptor}} |descriptor:PermissionDescriptor|, and a {{PermissionState}} |state:PermissionState|: -

      -
        -
      1. Let |settings| be the [=current settings object=].
      2. -
      3. Let |targets| be a list containing all [=environment settings objects=] - whose [=environment settings object/origin=] is [=same origin=] as - the [=environment settings object/origin=] of |settings|. -
      4. -
      5. Let |tasks| be an empty list.
      6. -
      7. For each environment settings object |target| in |targets|: -
          -
        1. - Queue a task |task| on the [=permissions task source=] of |target|'s - [=relevant settings object=]'s [=environment settings object/global object=]'s - [=Window/browsing context=] to perform the following step: -
            -
          1. Interpret |state| as if it were the - result of an invocation of permission state for |descriptor| with the - argument |target| made at this moment. -
          2. -
          -
        2. -
        3. [=list/Append=] |task| to |tasks|.
        4. -
        -
      8. -
      9. Wait for all tasks in |tasks| to have executed and return.
      10. -
      +
      +

      + To set a permission given a {{PermissionDescriptor}} |descriptor:PermissionDescriptor|, and a {{PermissionState}} |state:PermissionState|: +

      +
        +
      1. Let |settings| be the [=current settings object=].
      2. +
      3. Let |targets| be a list containing all [=environment settings objects=] + whose [=environment settings object/origin=] is [=same origin=] as + the [=environment settings object/origin=] of |settings|. +
      4. +
      5. Let |tasks| be an empty list.
      6. +
      7. For each environment settings object |target| in |targets|: +
          +
        1. + Queue a task |task| on the [=permissions task source=] of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
            +
          1. Interpret |state| as if it were the + result of an invocation of permission state for |descriptor| with the + argument |target| made at this moment. +
          2. +
          +
        2. +
        3. [=list/Append=] |task| to |tasks|.
        4. +
        +
      8. +
      9. Wait for all tasks in |tasks| to have executed and return.
      10. +
      +

      Automated testing with [[WebDriver]] @@ -1423,7 +1426,7 @@

    3. [=Set a permission=] with |typedDescriptor| and |state|.
    4. Return [=success=] with data `null`.
    - +

    From 4057e4af15fb2632438f974d18f186af5ef1be8a Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:50:44 +0100 Subject: [PATCH 27/28] [=environment settings object=] --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 172966d..da8e9e1 100644 --- a/index.html +++ b/index.html @@ -541,7 +541,7 @@

    If a {{DOMString}} |name| names one of these features, then |name|'s extra permission data for an optional - environment settings object |settings| is the result of the following algorithm: + [=environment settings object=] |settings| is the result of the following algorithm:

    1. If |settings| wasn't passed, set it to the [=current settings object=]. @@ -760,7 +760,7 @@

    A |descriptor|'s permission state, given an optional - environment settings object |settings| is the result of the following algorithm. + [=environment settings object=] |settings| is the result of the following algorithm. It returns a {{PermissionState}} enum value:

      @@ -1203,7 +1203,7 @@

      the [=environment settings object/origin=] of |settings|.
    1. Let |tasks| be an empty list.
    2. -
    3. For each environment settings object |target| in |targets|: +
    4. For each [=environment settings object=] |target| in |targets|:
      1. Queue a task |task| on the [=permissions task source=] of |target|'s From 01836921d047a9d2da7a9d9c51f114f500c0f9cc Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Wed, 22 Nov 2023 13:52:38 +0100 Subject: [PATCH 28/28] [=extension command URI template|URI Template=] --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index da8e9e1..51ace68 100644 --- a/index.html +++ b/index.html @@ -1240,7 +1240,7 @@

        HTTP Method

    - URI Template + [=extension command URI template|URI Template=]