diff --git a/source b/source index bd725815eb6..3c4b2f9241a 100644 --- a/source +++ b/source @@ -30121,8 +30121,8 @@ interface HTMLIFrameElement : HTMLElement { keyword allows the content to navigate its top-level browsing context; the allow-top-navigation-by-user-activation - keyword behaves similarly but only allows such navigation when - triggered by user activation; and the navigation only when + transient activation flag is true; and the allow-forms, allow-modals, allow-orientation-lock, MediaError {

A media element is said to be allowed to play if the user agent and the system allow media playback in the current context.

-

For example, a user agent could require that playback is triggered by user - activation, but an exception could be made to allow playback while For example, a user agent could allow playback only when transient + activation flag is true, but an exception could be made to allow playback while muted.

A media element is said to have ended playback when:

@@ -47715,8 +47715,8 @@ ldh-str = < as defined in click
event.

+ -
+

To prevent abuse of certain APIs that could be annoying to users (e.g. opening popups or + vibrating phones), Web browsers allow the use of these APIs only when the user is actively + interacting with the web page or have interacted with the page at least once. This "active + interaction" state is maintained through the user activation state object in each + Window.

-

The user agent should allow the user to manually trigger elements that have an activation - behavior, for instance using keyboard or voice input, or through mouse clicks. When the - user triggers an element with a defined activation behavior in a manner other than - clicking it, the default action of the interaction event must be to fire a click event at the element.

- +

Processing model

-

An algorithm is triggered by user - activation if any of the following conditions is true:

+

A user interaction activates a Window object + W if either:

+
    +
  • input events from the user interaction is targetted to an element of W, or
  • + +
  • the interaction activates the Window + object in a subframe of W.
  • +
+

The user activation state of a Window object W consists of + two boolean flags, both of which are initially set to false:

    -
  • The task in which the algorithm is running is currently - processing an activation behavior whose click - event's isTrusted attribute is true.

  • +
  • The sticky activation flag indicates the historical activation state: whether the + user has ever interacted with W or its subframes. The flag is set when W + is activated for the very first time, and is never + reset during the lifetime of W.
  • + +
  • The transient activation flag indicates the current activation state: whether the + user is currently interacting with W or its subframes. The flag is set every time + W is activated, and is reset either +
      +
    • after an expiry time defined by the browser, or
    • +
    • through a call to an activation-consuming API in the context of + any Window object of the page.
    • +
    +
  • +
-
  • -

    The task in which the algorithm is running is currently - running the event listener for an event whose isTrusted attribute is true and whose type is one of:

    +

    The propagation of the transient activation flag in the frame tree + is assymetric between setting vs resetting of the flag. A user interaction with a frame + F sets the flag in the Window object of each ancestor frame of + F (including F itself). However, an activation-consuming + API call in the context of the Window object of frame of F resets + the flag in all Window objects across the whole frame tree. This prevents + multiple calls to an activation-consuming API even when the frame hierarchy + is deep.

    -
      -
    • change
    • -
    • click
    • -
    • contextmenu
    • -
    • dblclick
    • -
    • mouseup
    • -
    • pointerup
    • -
    • reset
    • -
    • submit
    • -
    • touchend
    • -
    +

    APIs gated by user activation

    -
  • +

    APIs that are dependent on user activation state are classified into three + different levels. The levels are as follows, sorted by their "strength of dependence" on user + activation (from strongest to weakest):

    +
      +
    1. Transient activation consuming APIs: These APIs require the transient bit, and + they consume the bit in each call to prevent multiple calls per user activation.
    2. -
    3. -

      The task in which the algorithm is running was queued by an algorithm that was triggered by user - activation, and the chain of such algorithms started within a user-agent defined - timeframe.

      +
    4. Transient activation gated APIs: These APIs require the transient bit but don't + consume it, so multiple calls are allowed per user activation until the transient bit + expires.
    5. -

      For example, if a user clicked a button, it might be acceptable for a popup - to result from that after 4 seconds, but it would likely not be acceptable for a popup to result - from that after 4 hours.

      - +
    6. Sticky activation gated APIs: These APIs require the sticky activation bit, so + they are blocked until the very first user activation.
    7. +
    + + +

    Events triggering user activation

    + +
    + + + + + + +

    The event set is inconsistent across major browsers. See issue #3849.

    + +

    A Window object W is considered activated when W or any + elements of W receives an event whose isTrusted attribute is true and whose type is one of:

    +
      +
    • change
    • +
    • click
    • +
    • contextmenu
    • +
    • dblclick
    • +
    • mouseup
    • +
    • pointerup
    • +
    • reset
    • +
    • submit
    • +
    • touchend
    +

    Activation behavior of elements

    + +

    Certain elements in HTML have an activation behavior, which means that the user + can activate them. This is always caused by a click event.

    + +
    + +

    The user agent should allow the user to manually trigger elements that have an activation + behavior, for instance using keyboard or voice input, or through mouse clicks. When the + user triggers an element with a defined activation behavior in a manner other than + clicking it, the default action of the interaction event must be to fire a click event at the element.

    + +

    Focus

    @@ -77660,12 +77718,12 @@ console.assert(iframeWindow.frameElement === null); then:

      -
    1. If this algorithm is triggered by user activation and A's +

    2. If transient activation flag is true and A's active document's active sandboxing flag set has its sandboxed top-level navigation with user activation browsing context flag set, then return false.

    3. -
    4. Otherwise, if this algorithm is not triggered by user activation and +

    5. Otherwise, if transient activation flag is false and A's active document's active sandboxing flag set has its sandboxed top-level navigation without user activation browsing context flag set, then return false.

    6. @@ -77937,7 +77995,7 @@ console.assert(iframeWindow.frameElement === null); applicable option from the following list:

      - @@ -78391,6 +78449,7 @@ interface Window : Eve dictionary WindowPostMessageOptions : PostMessageOptions { USVString targetOrigin = "/"; + boolean transferUserActivation = false; };