diff --git a/index.bs b/index.bs
index 45986f9..f02fa41 100644
--- a/index.bs
+++ b/index.bs
@@ -263,6 +263,12 @@ attribute for the {{change}} event type.
The
requestPermission() method steps are:
+1. If [=this=]'s [=relevant global object=]'s [=associated Document=] is not
+ [=fully active=], return [=a promise rejected with=] a
+ "{{InvalidStateError}}" {{DOMException}}.
+
+ idle-detection-detached-frame.https.html
+
1. If the [=relevant global object=] of [=this=] does not have [=transient
activation=], return [=a promise rejected with=] a "{{NotAllowedError}}"
{{DOMException}}.
@@ -270,7 +276,9 @@ The
requestPermission() method steps are:
1. [=In parallel=]:
1. Let |permissionState| be the result of [=requesting permission to use=]
"idle-detection".
- 1. [=Resolve=] |result| with |permissionState|.
+ 1. [=Queue a global task=] on the [=relevant global object=] of [=this=]
+ using the [=idle detection task source=] to [=resolve=] |result| with
+ |permissionState|.
1. Return |result|.
@@ -281,15 +289,21 @@ The requestPermission() method steps are:
The start(|options|) method steps are:
-1. If the [=relevant global object=]'s [=associated Document=] is not [=allowed
- to use=] "idle-detection", return [=a promise rejected with=] a
- "{{NotAllowedError}}" {{DOMException}}.
+1. Let |document| be [=this=]'s [=relevant global object=]'s [=associated
+ Document=].
+1. If |document| is not [=fully active=], return [=a promise rejected with=] a
+ "{{InvalidStateError}}" {{DOMException}}.
- idle-detection-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
- idle-detection-allowed-by-feature-policy-attribute.https.sub.html
- idle-detection-allowed-by-feature-policy.https.sub.html
- idle-detection-default-feature-policy.https.sub.html
- idle-detection-disabled-by-feature-policy.https.sub.html
+ idle-detection-detached-frame.https.html
+
+1. If |document| is not [=allowed to use=] "idle-detection",
+ return [=a promise rejected with=] a "{{NotAllowedError}}" {{DOMException}}.
+
+ idle-detection-allowed-by-permissions-policy-attribute-redirect-on-load.https.sub.html
+ idle-detection-allowed-by-permissions-policy-attribute.https.sub.html
+ idle-detection-allowed-by-permissions-policy.https.sub.html
+ idle-detection-default-permissions-policy.https.sub.html
+ idle-detection-disabled-by-permissions-policy.https.sub.html
1. If |this|.{{IdleDetector/[[state]]}} is not `"stopped"`,
return [=a promise rejected with=] an "{{InvalidStateError}}" {{DOMException}}.
@@ -318,18 +332,22 @@ The start(|options|) method steps are:
1. [=In parallel=]:
1. Let |permissionState| be the [=permission state=] of `"idle-detection"`.
idle-permission.tentative.https.window.js
- 1. If |permissionState| is `"denied"`, [=queue a task=] on the
- [=idle detection task source=] to perform the following steps:
- 1. Set |this|.{{IdleDetector/[[state]]}} to `"stopped"`.
- 1. [=Reject=] |result| with a "{{NotAllowedError}}" {{DOMException}}.
- 1. Otherwise, [=queue a task=] on the [=idle detection task source=] to perform the
- following steps, but [=abort when=] |this|.{{IdleDetector/[[state]]}}
- becomes `"stopped"`.
- 1. Set |this|.{{IdleDetector/[[state]]}} to `"started"`.
- 1. Set |this|.{{IdleDetector/[[threshold]]}} to |options|["{{threshold}}"].
- 1. [=Resolve=] |result|.
+ 1. [=Queue a global task=] on the [=relevant global object=] of [=this=]
+ using the [=idle detection task source=] to perform the following steps:
+ 1. If |permissionState| is `"denied"`,
+ 1. Set |this|.{{IdleDetector/[[state]]}} to `"stopped"`.
+ 1. [=Reject=] |result| with a "{{NotAllowedError}}" {{DOMException}}.
+ 1. Otherwise,
+ 1. If |this|.{{IdleDetector/[[state]]}} is `"stopped"`, abort these
+ steps.
+ 1. Set |this|.{{IdleDetector/[[state]]}} to `"started"`.
+ 1. Set |this|.{{IdleDetector/[[threshold]]}} to |options|["{{threshold}}"].
+ 1. [=Resolve=] |result|.
1. Return |result|.
+Note: The steps above are performed [=in parallel=] to enable implementations
+ to check the permission state asynchronously.
+
@@ -442,6 +460,7 @@ conditions:
interceptor.https.html
+ page-visibility.https.html
# Security and privacy considerations # {#security-and-privacy}
@@ -453,7 +472,7 @@ conditions:
This interface exposes the state of global system properties and so care must be
taken to prevent them from being used as cross-origin communication or
identification channels. Similar concerns are present in specifications such as
-[[DEVICE-ORIENTATION]] and [[GEOLOCATION-API]], which mitigate them by requiring
+[[DEVICE-ORIENTATION]] and [[GEOLOCATION]], which mitigate them by requiring
a visible or focused context. This prevents multiple origins from observing the
global state at the same time. These mitigations are unfortunately inappropriate
here because the intent of this specification is precisely to allow a limited