-
Notifications
You must be signed in to change notification settings - Fork 3k
Carry over sticky activation for same-origin navs and traversals #11454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
361b667
ad0e6b8
fae6b36
3939d91
7e5c107
be03fd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80190,17 +80190,18 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
|
||
<h4 id="user-activation-data-model">Data model</h4> | ||
|
||
<p>For the purpose of tracking user activation, each <code>Window</code> <var>W</var> has two | ||
relevant values:</p> | ||
<p>For the purpose of tracking user activation, each <code>Window</code> <var>W</var> has the | ||
following relevant values:</p> | ||
|
||
<ul> | ||
<li><p>A <dfn>last activation timestamp</dfn>, which is either a | ||
<code>DOMHighResTimeStamp</code>, positive infinity (indicating that <var>W</var> has never been | ||
activated), or negative infinity (indicating that the activation has been <span data-x="consume | ||
user activation">consumed</span>). Initially positive infinity.</p></li> | ||
|
||
<li><p>A <dfn>last history-action activation timestamp</dfn>, which is either a | ||
<code>DOMHighResTimeStamp</code> or positive infinity, initially positive infinity.</p></li> | ||
<li><p>A <dfn>has history-action activation</dfn> boolean, initially false.</p></li> | ||
|
||
<li><p>A <dfn>has sticky activation</dfn> boolean, initially false.</p></li> | ||
</ul> | ||
|
||
<p>A user agent also defines a <dfn>transient activation duration</dfn>, which is a constant | ||
|
@@ -80216,13 +80217,13 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
<dl> | ||
<dt><dfn export>Sticky activation</dfn></dt> | ||
<dd> | ||
<p>When the <span>current high resolution time</span> given <var>W</var> is greater than or | ||
equal to the <span>last activation timestamp</span> in <var>W</var>, <var>W</var> is said to | ||
have <span>sticky activation</span>.</p> | ||
<p>When <var>W</var>'s <span>has sticky activation</span> is true, <var>W</var> is said to have | ||
<span>sticky activation</span>.</p> | ||
|
||
<p>This is <var>W</var>'s historical activation state, indicating whether the user has ever | ||
interacted in <var>W</var>. It starts false, then changes to true (and never changes back to | ||
false) when <var>W</var> gets the very first <span>activation notification</span>.</p> | ||
false) when <var>W</var> gets the very first <span>activation notification</span>. It is also | ||
carried over between windows for same-origin navigations and traversals.</p> | ||
|
||
</dd> | ||
|
||
<dt><dfn export>Transient activation</dfn></dt> | ||
|
@@ -80245,9 +80246,8 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
|
||
<dt><dfn>History-action activation</dfn></dt> | ||
<dd> | ||
<p>When the <span>last history-action activation timestamp</span> of <var>W</var> is not equal | ||
to the <span>last activation timestamp</span> of <var>W</var>, then <var>W</var> is said to have | ||
<span>history-action activation</span>.</p> | ||
<p>When <var>W</var>'s <span>has history-action activation</span> is true, then <var>W</var> is | ||
said to have <span>history-action activation</span>.</p> | ||
|
||
<p>This is a special variant of user activation, used to allow access to certain session history | ||
APIs which, if used too frequently, would make it harder for the user to traverse back using <a | ||
|
@@ -80260,16 +80260,15 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
</dd> | ||
</dl> | ||
|
||
<p class="note">The <span>last activation timestamp</span> and <span>last history-action | ||
activation timestamp</span> are retained even after the <code>Document</code> changes its | ||
<span>fully active</span> status (e.g., after navigating away from a <code>Document</code>, or | ||
navigating to a cached <code>Document</code>). This means <span>sticky activation</span> state | ||
spans multiple navigations as long as the same <code>Document</code> gets reused. For the | ||
transient activation state, the original <span data-x="activation-expiry">expiry</span> time | ||
remains unchanged (i.e., the state still expires within the <span>transient activation | ||
duration</span> limit from the original <span>activation triggering input event</span>). It is | ||
important to consider this when deciding whether to base certain things off <span>sticky | ||
activation</span> or <span>transient activation</span>.</p> | ||
<p class="note" id="note-user-activation-and-navigation">The underlying values are retained even | ||
after the <code>Document</code> changes its <span>fully active</span> status (e.g., after | ||
navigating away from a <code>Document</code>, or navigating to a cached <code>Document</code>). | ||
This means <span>sticky activation</span> and <span>history-action activation</span> spans | ||
multiple navigations as long as the same <code>Document</code> gets reused. For the transient | ||
activation state, the original <span data-x="activation-expiry">expiry</span> time remains | ||
unchanged (i.e., the state still expires within the <span>transient activation duration</span> | ||
limit from the original <span>activation triggering input event</span>). It is important to | ||
consider this when deciding what type of activation to base certain things off of.</p> | ||
|
||
<h4 id="user-activation-processing-model">Processing model</h4> | ||
|
||
|
@@ -80302,6 +80301,10 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
<li><p>Set <var>window</var>'s <span>last activation timestamp</span> to the <span>current | ||
high resolution time</span>.</p></li> | ||
|
||
<li><p>Set <var>window</var>'s <span>has history-action activation</span> to true.</p></li> | ||
|
||
<li><p>Set <var>window</var>'s <span>has sticky activation</span> to true.</p></li> | ||
|
||
<li><p><span>Notify the close watcher manager about user activation</span> given | ||
<var>window</var>.</p></li> | ||
</ol> | ||
|
@@ -80369,8 +80372,7 @@ interface <dfn interface>VisibilityStateEntry</dfn> : <span>PerformanceEntry</sp | |
<var>navigables</var>.</p></li> | ||
|
||
<li><p><span data-x="list iterate">For each</span> <var>window</var> in <var>windows</var>, set | ||
<var>window</var>'s <span>last history-action activation timestamp</span> to <var>window</var>'s | ||
<span>last activation timestamp</span>.</p></li> | ||
<var>window</var>'s <span>has history-action activation</span> to false.</p></li> | ||
</ol> | ||
|
||
<p class="note">Note the asymmetry in the sets of <span data-x="browsing context">browsing | ||
|
@@ -106369,6 +106371,13 @@ location.href = '#foo';</code></pre> | |
<var>realmExecutionContext</var>, <var>navigationParams</var>'s <span | ||
data-x="navigation-params-reserved-environment">reserved environment</span>, | ||
<var>topLevelCreationURL</var>, and <var>topLevelOrigin</var>.</p></li> | ||
|
||
<li><p>If <var>navigable</var>'s <span data-x="nav-window">active window</span> has | ||
<span>sticky activation</span>, and <var>navigable</var>'s <span data-x="nav-document">active | ||
document</span>'s <span data-x="concept-document-origin">origin</span> is <span>same | ||
origin</span> with <var>navigationParams</var>'s <span | ||
data-x="navigation-params-origin">origin</span>, then set <var>window</var>'s <span>has sticky | ||
activation</span> to true.</p></li> | ||
</ol> | ||
domenic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
<p class="note">This is the usual case, where the new <code>Document</code> we're about to | ||
|
Uh oh!
There was an error while loading. Please reload this page.