Skip to content

Commit ad0e6b8

Browse files
committed
Simplify per code review, also for history
1 parent 361b667 commit ad0e6b8

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

source

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80199,10 +80199,9 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8019980199
activated), or negative infinity (indicating that the activation has been <span data-x="consume
8020080200
user activation">consumed</span>). Initially positive infinity.</p></li>
8020180201

80202-
<li><p>A <dfn>last history-action activation timestamp</dfn>, which is either a
80203-
<code>DOMHighResTimeStamp</code> or positive infinity, initially positive infinity.</p></li>
80202+
<li><p>A <dfn>has history-action activation</dfn> boolean, initially false.</p></li>
8020480203

80205-
<li><p>A <dfn>sticky activation override</dfn>, a boolean, initially false.</p></li>
80204+
<li><p>A <dfn>has sticky activation</dfn> boolean, initially false.</p></li>
8020680205
</ul>
8020780206

8020880207
<p>A user agent also defines a <dfn>transient activation duration</dfn>, which is a constant
@@ -80218,10 +80217,8 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8021880217
<dl>
8021980218
<dt><dfn export>Sticky activation</dfn></dt>
8022080219
<dd>
80221-
<p>When the <span>current high resolution time</span> given <var>W</var> is greater than or
80222-
equal to the <span>last activation timestamp</span> in <var>W</var>, or <var>W</var>'s
80223-
<span>sticky activation override</span> is true, <var>W</var> is said to have <span>sticky
80224-
activation</span>.</p>
80220+
<p>When <var>W</var>'s <span>has sticky activation</span> is true, <var>W</var> is said to have
80221+
<span>sticky activation</span>.</p>
8022580222

8022680223
<p>This is <var>W</var>'s historical activation state, indicating whether the user has ever
8022780224
interacted in <var>W</var>. It starts false, then changes to true (and never changes back to
@@ -80249,9 +80246,8 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8024980246

8025080247
<dt><dfn>History-action activation</dfn></dt>
8025180248
<dd>
80252-
<p>When the <span>last history-action activation timestamp</span> of <var>W</var> is not equal
80253-
to the <span>last activation timestamp</span> of <var>W</var>, then <var>W</var> is said to have
80254-
<span>history-action activation</span>.</p>
80249+
<p>When <var>W</var>'s <span>has history-action activation</span> is true, then <var>W</var> is
80250+
said to have <span>history-action activation</span>.</p>
8025580251

8025680252
<p>This is a special variant of user activation, used to allow access to certain session history
8025780253
APIs which, if used too frequently, would make it harder for the user to traverse back using <a
@@ -80264,16 +80260,15 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8026480260
</dd>
8026580261
</dl>
8026680262

80267-
<p class="note">The <span>last activation timestamp</span> and <span>last history-action
80268-
activation timestamp</span> are retained even after the <code>Document</code> changes its
80269-
<span>fully active</span> status (e.g., after navigating away from a <code>Document</code>, or
80270-
navigating to a cached <code>Document</code>). This means <span>sticky activation</span> state
80271-
spans multiple navigations as long as the same <code>Document</code> gets reused. For the
80272-
transient activation state, the original <span data-x="activation-expiry">expiry</span> time
80273-
remains unchanged (i.e., the state still expires within the <span>transient activation
80274-
duration</span> limit from the original <span>activation triggering input event</span>). It is
80275-
important to consider this when deciding whether to base certain things off <span>sticky
80276-
activation</span> or <span>transient activation</span>.</p>
80263+
<p class="note" id="note-user-activation-and-navigation">The underlying values are retained even
80264+
after the <code>Document</code> changes its <span>fully active</span> status (e.g., after
80265+
navigating away from a <code>Document</code>, or navigating to a cached <code>Document</code>).
80266+
This means <span>sticky activation</span> and <span>history-action activation</span> spans
80267+
multiple navigations as long as the same <code>Document</code> gets reused. For the transient
80268+
activation state, the original <span data-x="activation-expiry">expiry</span> time remains
80269+
unchanged (i.e., the state still expires within the <span>transient activation duration</span>
80270+
limit from the original <span>activation triggering input event</span>). It is important to
80271+
consider this when deciding what type of activation to base certain things off of.</p>
8027780272

8027880273
<h4 id="user-activation-processing-model">Processing model</h4>
8027980274

@@ -80306,6 +80301,10 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8030680301
<li><p>Set <var>window</var>'s <span>last activation timestamp</span> to the <span>current
8030780302
high resolution time</span>.</p></li>
8030880303

80304+
<li><p>Set <var>window</var>'s <span>has history-action activation</span> to true.</p></li>
80305+
80306+
<li><p>Set <var>window</var>'s <span>has sticky activation</span> to true.</p></li>
80307+
8030980308
<li><p><span>Notify the close watcher manager about user activation</span> given
8031080309
<var>window</var>.</p></li>
8031180310
</ol>
@@ -80373,8 +80372,7 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp
8037380372
<var>navigables</var>.</p></li>
8037480373

8037580374
<li><p><span data-x="list iterate">For each</span> <var>window</var> in <var>windows</var>, set
80376-
<var>window</var>'s <span>last history-action activation timestamp</span> to <var>window</var>'s
80377-
<span>last activation timestamp</span>.</p></li>
80375+
<var>window</var>'s <span>has history-action activation</span> to false.</p></li>
8037880376
</ol>
8037980377

8038080378
<p class="note">Note the asymmetry in the sets of <span data-x="browsing context">browsing
@@ -106378,8 +106376,8 @@ location.href = '#foo';</code></pre>
106378106376
<span>sticky activation</span>, and <var>navigable</var>'s <span data-x="nav-document">active
106379106377
document</span>'s <span data-x="concept-document-origin">origin</span> is <span>same
106380106378
origin</span> with <var>navigationParams</var>'s <span
106381-
data-x="navigation-params-origin">origin</span>, then set <var>window</var>'s <span>sticky
106382-
activation override</span> to true.</p></li>
106379+
data-x="navigation-params-origin">origin</span>, then set <var>window</var>'s <span>has sticky
106380+
activation</span> to true.</p></li>
106383106381
</ol>
106384106382

106385106383
<p class="note">This is the usual case, where the new <code>Document</code> we're about to

0 commit comments

Comments
 (0)