Skip to content

Commit

Permalink
editorial: Use new HTML activation model
Browse files Browse the repository at this point in the history
Adapt to whatwg/html#5129 and follow the spec editing advice from
https://docs.google.com/document/d/14wT89JZ0qeRehXGkcn3_meXxjvlHKgM9d7aJj80kQcQ/edit ("User
Activation: Guidance for spec authors") by replacing "triggered by user
activation" with "the current global object has transient activation".

This makes ReSpec happy again.
  • Loading branch information
rakuco committed Feb 5, 2020
1 parent 92a2f7a commit 097b84d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@ <h2>
<li>If |state| is {{PermissionState["prompt"]}}, run the following
steps:
<ol>
<li>If these <a>obtain permission</a> steps were not <a>triggered
by user activation</a>, return {{PermissionState["denied"]}}.
<li>If the <a>current global object</a> is not a {{Window}},
return {{PermissionState["denied"]}}.
</li>
<li>If the <a>current global object</a> does not have [=transient
activation=], return {{PermissionState["denied"]}}.
</li>
<li>Return the result of <a>requesting permission to use</a> with
|permissionDesc|.
Expand All @@ -304,13 +307,12 @@ <h2>
</ol>
<aside class="note">
In the case the steps are run from a dedicated worker, then the
<a>current global object</a> is a {{DedicatedWorkerGlobalScope}},
which means that the <a>obtain permission</a> steps can never be
<a>triggered by user activation</a>, meaning that in order to use
wake locks from a dedicated worker, prior permission needs to granted
from the <a>browsing context</a> who created it, e.g. the <a>browsing
context</a> that is exists in the {{DedicatedWorkerGlobalScope}}'s
[=WorkerGlobalScope/owner set=].
<a>current global object</a> is a {{DedicatedWorkerGlobalScope}}, for
which the concept of [=transient activation=] is not defined.
Consequently, in order to use wake locks from a dedicated worker,
prior permission needs to be granted from the <a>browsing context</a>
who created it, e.g. the <a>browsing context</a> that is exists in
the {{DedicatedWorkerGlobalScope}}'s [=WorkerGlobalScope/owner set=].
</aside>
</section>
</section>
Expand Down

0 comments on commit 097b84d

Please sign in to comment.