Example 6: A permission descriptor that defines a partial order
@@ -898,15 +896,14 @@
Permissions
permission state constraints:
- Constraints on the values that the user agent can return as a descriptor's permission
- state. Defaults to no constraints beyond the user's intent.
+ Constraints on the values that the user agent can return as a descriptor's permission state. Defaults to no constraints beyond the user's intent.
:
- Some powerful features have more information associated with them than just a
+ Some powerful features have more information associated with them than just a
PermissionState
. Each of these features defines an .
Note
@@ -915,14 +912,13 @@
Permissions
If a DOMString
name names one of these features, then name's 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:
- If settings wasn't passed, set it to the current settings object.
- If there was a previous invocation of this algorithm with the same name and
- settings, returning previousResult, and the user agent has not received new
- information about the user's intent since that invocation, return previousResult.
+ settings, returning previousResult, and the user agent has not received new information about the user's intent since that invocation, return previousResult.
- Return the instance of name's
that matches the UA's impression of the user's intent, taking into account any
@@ -959,8 +955,7 @@
Permissions
The default permission query algorithm, given a
@@ -969,7 +964,7 @@
Permissions
@@ -990,7 +985,7 @@ Permissions
Takes an environment settings object, and returns a new permission key. If
- unspecified, this defaults to the default permission key generation algorithm. A
+ unspecified, this defaults to the default permission key generation algorithm. A
feature that specifies a custom permission key generation algorithm MUST also specify a permission key comparison algorithm.
@@ -1014,8 +1009,7 @@
Permissions
Takes two permission keys and returns a boolean that shows whether the two keys
- are equal. If unspecified, this defaults to the default permission key comparison
- algorithm.
+ are equal. If unspecified, this defaults to the default permission key comparison algorithm.
The default permission key comparison algorithm, given
@@ -1033,7 +1027,7 @@
Permissions
Takes no arguments. Updates any other parts of the implementation that need to be kept
- in sync with changes in the results of permission states or .
+ in sync with changes in the results of permission states or .
If unspecified, this defaults to running react to the user revoking permission.
@@ -1100,7 +1094,7 @@
Permissions
- A default powerful feature is a powerful feature with all
+ A default powerful feature is a powerful feature with all
of the above types and algorithms defaulted.
@@ -1127,7 +1121,7 @@
Permissions
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:
@@ -1142,7 +1136,7 @@ Permissions
- Let document be settings' relevant global object's associated
Document
.
- - If document is not allowed to use feature, return
+
- If document is not allowed to use feature, return
"
denied
".
@@ -1160,8 +1154,7 @@
Permissions
- As a shorthand, a DOMString
name's permission state is the permission
- state of a PermissionDescriptor
with its name
member set
+ As a shorthand, a DOMString
name's permission state is the permission state of a PermissionDescriptor
with its name
member set
to name.
@@ -1175,17 +1168,17 @@
Permissions
granted
" or "denied
".
- - Let current state be the descriptor's permission state.
+
- Let current state be the descriptor's permission state.
- If current state is not "
prompt
", return current
state and abort these steps.
- - Ask the user for express permission for the calling algorithm to use the
- powerful feature described by descriptor.
+
- Ask the user for express permission for the calling algorithm to use the
+ powerful feature described by descriptor.
- If the user gives express permission to use the powerful feature, set current
state to "
granted
"; otherwise to "denied
". The
- user's interaction may provide new information about the user's intent for the
+ user's interaction may provide new information about the user's intent for the
origin.
Note
This is intentionally vague about the details of the permission UI and how the user
@@ -1202,8 +1195,8 @@
Permissions
- As a shorthand, requesting permission to use a DOMString
name, is the same
- as requesting permission to use a PermissionDescriptor
with its
+ As a shorthand, requesting permission to use a DOMString
name, is the same
+ as requesting permission to use a PermissionDescriptor
with its
name
member set to name.
@@ -1213,20 +1206,20 @@
Permissions
To prompt the user to choose one or more options associated with a given
- descriptor and an optional boolean allowMultiple
+ descriptor and an optional boolean allowMultiple
(default false), the user agent must perform the following steps. This algorithm returns
either "denied
" or the user's selection.
- - If descriptor's permission state is "
denied
", return
+ - If descriptor's permission state is "
denied
", return
"denied
" and abort these steps.
- - If descriptor's permission state is "
granted
", the user
+ - If descriptor's permission state is "
granted
", the user
agent may return one (or more if allowMultiple is true) of options chosen by the user
and abort these steps. If the user agent returns without prompting, then subsequent
prompts for the user to choose from the same
set of options with the same descriptor must return the same option(s), unless the user
- agent receives new information about the user's intent.
+ agent receives new information about the user's intent.
- Ask the user to choose one or more options or deny permission, and wait for them to
choose:
@@ -1249,8 +1242,8 @@
Permissions
- As a shorthand, prompting the user to choose from options associated with a
- DOMString
name, is the same as prompting the user to choose from those
+ As a shorthand, prompting the user to choose from options associated with a
+ DOMString
name, is the same as prompting the user to choose from those
options associated with a PermissionDescriptor
with its name
member set to name.
@@ -1480,24 +1473,22 @@
Permissions
- When the query()
method is invoked, the user agent MUST run the
+ When the query()
method is invoked, the user agent MUST run the
following query a permission algorithm, passing the parameter
permissionDesc:
- If this's relevant global object is a
Window
object, then:
- - If the current settings object's associated
Document
is not
+ - If the current settings object's associated
Document
is not
fully active, return a promise rejected with an
"InvalidStateError
" DOMException
.
- - Let rootDesc be the object permissionDesc refers to, converted to an IDL
- value of type
PermissionDescriptor
.
+ - Let rootDesc be the object permissionDesc refers to, converted to an IDL value of type
PermissionDescriptor
.
- - If the conversion throws an exception, return a promise
- rejected with that exception.
+
- If the conversion throws an exception, return a promise rejected with that exception.
- If rootDesc["
name
"] is not supported, return a promise rejected with a TypeError
.
Note: Why is this not an enum?
- - Let typedDescriptor be the object permissionDesc refers to, converted to an
- IDL value of rootDesc's
name
's permission descriptor type.
+ - Let typedDescriptor be the object permissionDesc refers to, converted to an IDL value of rootDesc's
name
's permission descriptor type.
- - If the conversion throws an exception, return a promise
- rejected with that exception.
+
- If the conversion throws an exception, return a promise rejected with that exception.
- Let promise be a new promise.
- Return promise and continue in parallel:
- - Let status be create a
PermissionStatus
with typedDescriptor.
+ - Let status be create a
PermissionStatus
with typedDescriptor.
- Let query be status's
[[query]]
internal slot.
@@ -1780,8 +1769,8 @@ Permissions
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.
+ the following extension commands for the [WebDriver] specification. It is OPTIONAL
+ for a user agent to support extension commands commands.
dictionary PermissionSetParameters
{
required PermissionDescriptor
descriptor
;
@@ -1909,46 +1898,44 @@ Permissions
The Set Permission
- extension command simulates user modification of a PermissionDescriptor
's
- permission state.
+ extension command simulates user modification of a PermissionDescriptor
's
+ permission state.
- The remote end steps are:
+ The remote end steps are:
- - Let parameters be the parameters argument, converted to an IDL value of
+
- Let parameters be the parameters argument, converted to an IDL value of
type
PermissionSetParameters
. If this throws an exception, return an invalid argument error.
- Let rootDesc be parameters.
descriptor
.
- - Let typedDescriptor be the object rootDesc refers to, converted to an IDL
- value of
rootDesc.name
's permission descriptor type. If this throws an exception, return a invalid argument error.
+ - Let typedDescriptor be the object rootDesc refers to, converted to an IDL value of
rootDesc.name
's permission descriptor type. If this throws an exception, return a invalid argument error.
- - If parameters.
state
is an inappropriate permission
- state for any implementation-defined reason, return a invalid argument error.
+ - If parameters.
state
is an inappropriate permission state for any implementation-defined reason, return a invalid argument error.
- Let settings be the current settings object.
- - Let targets be a list containing all environment settings objects
+
- Let targets be a list containing all environment settings objects
whose origin is the same as
the origin of settings.
- - Let tasks be an empty list.
+
- Let tasks be an empty list.
- - For each environment settings object target in targets:
+
- For each environment settings object target in targets:
-
- Queue a task task on the permissions task source of target's
+ Queue a task task on the permissions task source of target's
relevant settings object's global object's
browsing context to perform the following step:
- Interpret parameters.
state
as if it were the
- result of an invocation of permission state for typedDescriptor with the
+ result of an invocation of permission state for typedDescriptor with the
argument target made at this moment.
@@ -1957,9 +1944,9 @@ Permissions
- - Wait for all tasks in tasks to have executed.
+
- Wait for all tasks in tasks to have executed.
- - Return success with data
null
.
+ - Return success with data
null
.