diff --git a/source b/source index 61d173f9d79..669d3d51f2c 100644 --- a/source +++ b/source @@ -80190,8 +80190,8 @@ interface VisibilityStateEntry : PerformanceEntryData model -

For the purpose of tracking user activation, each Window W has two - relevant values:

+

For the purpose of tracking user activation, each Window W has the + following relevant values:

A user agent also defines a transient activation duration, which is a constant @@ -80216,13 +80217,14 @@ interface VisibilityStateEntry : PerformanceEntry

Sticky activation
-

When the current high resolution time given W is greater than or - equal to the last activation timestamp in W, W is said to - have sticky activation.

+

When W's has sticky activation is true, W is said to have + sticky activation.

This is W's historical activation state, indicating whether the user has ever interacted in W. It starts false, then changes to true (and never changes back to - false) when W gets the very first activation notification.

+ false) when W gets the very first activation notification. It is also + carried over between windows for same-origin navigations and traversals (including during reactivation from bfcache).

Transient activation
@@ -80245,9 +80247,8 @@ interface VisibilityStateEntry : PerformanceEntryHistory-action activation
-

When the last history-action activation timestamp of W is not equal - to the last activation timestamp of W, then W is said to have - history-action activation.

+

When W's has history-action activation is true, then W is + said to have history-action activation.

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 VisibilityStateEntry : PerformanceEntry -

The last activation timestamp and last history-action - activation timestamp are retained even after the Document changes its - fully active status (e.g., after navigating away from a Document, or - navigating to a cached Document). This means sticky activation state - spans multiple navigations as long as the same Document gets reused. For the - transient activation state, the original expiry time - remains unchanged (i.e., the state still expires within the transient activation - duration limit from the original activation triggering input event). It is - important to consider this when deciding whether to base certain things off sticky - activation or transient activation.

+

The underlying values are retained even + after the Document changes its fully active status (e.g., after + navigating away from a Document, or navigating to a cached Document). + This means sticky activation and history-action activation spans + multiple navigations as long as the same Document gets reused. For the transient + activation state, the original expiry time remains + unchanged (i.e., the state still expires within the transient activation duration + limit from the original activation triggering input event). It is important to + consider this when deciding what type of activation to base certain things off of.

Processing model

@@ -80302,6 +80302,10 @@ interface VisibilityStateEntry : PerformanceEntry

Set window's last activation timestamp to the current high resolution time.

+
  • Set window's has history-action activation to true.

  • + +
  • Set window's has sticky activation to true.

  • +
  • Notify the close watcher manager about user activation given window.

  • @@ -80369,8 +80373,7 @@ interface VisibilityStateEntry : PerformanceEntrynavigables.

  • For each window in windows, set - window's last history-action activation timestamp to window's - last activation timestamp.

  • + window's has history-action activation to false.

    Note the asymmetry in the sets of browsing @@ -104898,6 +104901,15 @@ location.href = '#foo'; entries for the navigation API given navigable and targetStep.

    +
  • Let stickyActivationToCarryOver be false.

  • + +
  • If displayedDocument's relevant global object has sticky + activation, and displayDocument's origin is same origin with + targetEntry's document's origin, then set stickyActivationToCarryOver + to true.

  • +
  • If changingNavigableContinuation's update-only is true, or @@ -104950,7 +104962,8 @@ location.href = '#foo'; changingNavigableContinuation's update-only, scriptHistoryLength, scriptHistoryIndex, navigationType, - entriesForNavigationAPI, and previousEntry.

  • + entriesForNavigationAPI, previousEntry, and + stickyActivationToCarryOver.

  • If targetEntry's document is equal to displayedDocument, then perform updateDocument.

  • @@ -105480,8 +105493,9 @@ location.href = '#foo'; doNotReactivate, integers scriptHistoryLength and scriptHistoryIndex, NavigationType-or-null navigationType, an optional list of session history entries - entriesForNavigationAPI, and an optional session history entry - previousEntryForActivation:

    + entriesForNavigationAPI, an optional session history entry + previousEntryForActivation, and an optional boolean + stickyActivationToCarryOver (default false):

    1. Let documentIsNew be true if document's latest entry @@ -105657,7 +105671,8 @@ location.href = '#foo';

    2. Assert: entriesForNavigationAPI is given.

    3. Reactivate document given - entry and entriesForNavigationAPI.

      + entry, entriesForNavigationAPI, and + stickyActivationToCarryOver.

    documentsEntryChanged can be false for one of two reasons: either we @@ -105708,8 +105723,9 @@ location.href = '#foo';

    To reactivate a Document document given a session history entry - reactivatedEntry and a list of session history entries entriesForNavigationAPI:

    + reactivatedEntry, a list of session + history entries entriesForNavigationAPI, and a boolean + stickyActivationToCarryOver:

    This algorithm updates document after it has come out of bfcache, i.e., after it has been made fully active @@ -105718,6 +105734,16 @@ location.href = '#foo'; of events that happen in effect of the change is clear.

      +
    1. +

      If stickyActivationToCarryOver is true, then set document's + relevant global object's has sticky activation to true.

      + +

      This means we are performing a + same-origin traverse from a document with sticky activation, in which case, we want to carry + over sticky activation if present, even if this bfcached Document did not + originally have it.

      +
    2. +
    3. For each formControl of form controls in document with an autofill field name of "off", invoke the data-x="navigation-params-origin">origin.

    4. -

      If navigable's container is not null, - then:

      +

      If navigationParams's navigable's container is not null, then:

      1. Let parentEnvironment be navigable's realmExecutionContext, navigationParams's reserved environment, topLevelCreationURL, and topLevelOrigin.

      2. + +
      3. If browsingContext's active window has sticky + activation, and browsingContext's active document's origin is same origin with + navigationParams's origin, then set + window's has sticky activation to true.

      This is the usual case, where the new Document we're about to