Skip to content

Commit

Permalink
editorial: Adapt to Page Visibility spec integration into HTML (#332)
Browse files Browse the repository at this point in the history
The Page Visibility spec has been merged into the HTML spec itself. This
merge got rid of some terms and changed a few others, so adjust things
accordingly here:

* Instead of calling the "determine the visibility state", access a
  Document's "visibility state" directly.
* The "external now hidden algorithm" no longer exists; now there are "page
  visibility change steps" called with a Document and a visibility state.
  (The HTML spec itself says specs should have the HTML spec call these
  steps so that the order of calls is defined in the spec, which we might
  need to do later).

Fixes #331
  • Loading branch information
Raphael Kubo da Costa authored Dec 7, 2021
1 parent 4eddbe4 commit dc2008b
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,9 @@ <h3>
|document| is not [=Document/fully active=], return [=a promise
rejected with=] with a {{"NotAllowedError"}} {{DOMException}}.
</li>
<li data-tests="wakelock-document-hidden-manual.https.html">If the
steps to <a>determine the visibility state</a> return `hidden`,
return [=a promise rejected with=] {{"NotAllowedError"}}
{{DOMException}}.
<li data-tests="wakelock-document-hidden-manual.https.html">If
|document|'s [=Document/visibility state=] is "`hidden`", return [=a
promise rejected with=] {{"NotAllowedError"}} {{DOMException}}.
</li>
<li>Let |promise:Promise| be [=a new promise=].
</li>
Expand All @@ -366,8 +365,8 @@ <h3>
source</a> given |document|'s <a>relevant global object</a> to
run these steps:
<ol>
<li>If the steps to <a>determine the visibility state</a>
return `hidden`, then:
<li>If |document|'s [=Document/visibility state=] is
"`hidden`", then:
<ol>
<li>Reject |promise| with a {{"NotAllowedError"}}
{{DOMException}}.
Expand Down Expand Up @@ -677,12 +676,13 @@ <h3>
<dfn>Handling document loss of visibility</dfn>
</h3>
<p data-tests="wakelock-document-hidden-manual.https.html">
This specification defines the following <a>external now hidden
algorithm</a>, which is run when the user agent determines that the
[=Document/visibility state=] of a {{Document}} |document:Document|
of a <a>top-level browsing context</a> has become `hidden`:
This specification defines the following [=page visibility change
steps=] with [=Document/visibility state=] |state| and
|document:Document|:
</p>
<ol class="algorithm">
<li>If |state| is not "`hidden`", abort these steps.
</li>
<li>[=list/For each=] |lock:WakeLockSentinel| in
|document|.{{Document/[[ActiveLocks]]}}["`screen`"]:
<ol>
Expand All @@ -692,10 +692,6 @@ <h3>
</ol>
</li>
</ol>
<aside class="note">
The [=Document/visibility state=] is only exposed on the {{Window}}
object.
</aside>
</section>
<section>
<h3>
Expand Down

0 comments on commit dc2008b

Please sign in to comment.