Skip to content

Commit

Permalink
Add "regaining document full activity steps"
Browse files Browse the repository at this point in the history
These steps will be run when a document regains full activity after restoring it from BFCache. This does not currently introduce any behavior changes within the HTML spec, but allows other specs to define the steps they will take when a document becomes fully active again, e.g. send updates to the renderer about the current Geolocation state, etc.

Fixes whatwg#8872.
  • Loading branch information
rakina committed Feb 16, 2023
1 parent eaceee9 commit 5b5e961
Showing 1 changed file with 33 additions and 22 deletions.
55 changes: 33 additions & 22 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -94267,6 +94267,39 @@ location.href = '#foo';</code></pre>
href="#note-bfcache">bfcache</a>, i.e., after it has been made <span>fully active</span>
again.</p>

<ol>
<li>
<p>Run any <span>regaining document full activity steps</span> for <var>document</var> that are
defined by this specification and <span>other applicable specifications</span>.</p>
</li>

<li>
<p>If <var>document</var>'s <span>current document readiness</span> is "<code
data-x="">complete</code>", and <var>document</var>'s <span>page showing</span> flag is false,
then:</p>

<ol>
<li><p>Set <var>document</var>'s <span>page showing</span> flag to true.</p></li>

<li><p><span>Update the visibility state</span> of <var>document</var> to "<code
data-x="">visible</code>".</p></li>

<li><p><span>Fire a page transition event</span> named <code
data-x="event-pageshow">pageshow</code> at <var>document</var>'s <span>relevant global
object</span> with true.</p></li>
</ol>

<!-- an interesting thing to test would be to traverse back during onload, before the first
pageshow has fired, and then to traverse forward again, and see if we get _two_ pageshows. If
so, it indicates that browsers don't have a "page showing" flag like this and that the history
traversal task source has a higher priority than the DOM manipulation task source. -->
</li>
</ol>

<p>This specification defines the following <dfn export>regaining document full activity steps</dfn>.
Other specifications can define more. Note that these steps must not run script.<br>
Given a <code>Document</code> <var>document</var>:</p>

<ol>
<li id="history-autocomplete"><p><span data-x="list iterate">For each</span>
<var>formControl</var> of form controls in <var>document</var> with an <span>autofill field
Expand All @@ -94293,28 +94326,6 @@ location.href = '#foo';</code></pre>
<var>suspendDuration</var>.</p></li>
</ol>
</li>

<li>
<p>If <var>document</var>'s <span>current document readiness</span> is "<code
data-x="">complete</code>", and <var>document</var>'s <span>page showing</span> flag is false,
then:</p>

<ol>
<li><p>Set <var>document</var>'s <span>page showing</span> flag to true.</p></li>

<li><p><span>Update the visibility state</span> of <var>document</var> to "<code
data-x="">visible</code>".</p></li>

<li><p><span>Fire a page transition event</span> named <code
data-x="event-pageshow">pageshow</code> at <var>document</var>'s <span>relevant global
object</span> with true.</p></li>
</ol>

<!-- an interesting thing to test would be to traverse back during onload, before the first
pageshow has fired, and then to traverse forward again, and see if we get _two_ pageshows. If
so, it indicates that browsers don't have a "page showing" flag like this and that the history
traversal task source has a higher priority than the DOM manipulation task source. -->
</li>
</ol>

<p>To <dfn>try to scroll to the fragment</dfn> for a <code>Document</code> <var>document</var>,
Expand Down

0 comments on commit 5b5e961

Please sign in to comment.