diff --git a/images/inert-example-loading-section.png b/images/inert-example-loading-section.png new file mode 100644 index 00000000000..b94a3da0d5a Binary files /dev/null and b/images/inert-example-loading-section.png differ diff --git a/source b/source index 737bb2c7c36..f2b1ad0c18f 100644 --- a/source +++ b/source @@ -1827,7 +1827,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • If removedNode's popover attribute is not in the no popover state, then run the hide - popover algorithm given removedNode, false, true, and false.

  • + popover algorithm given removedNode, false, false, and false.

    A potential destination

  • translating a potential destination
  • script-like destinations
  • -
  • priority
  • +
  • priority
  • origin
  • referrer
  • synchronous flag
  • @@ -7579,6 +7579,47 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute implicitly potentially render-blocking, which will be defined at the individual elements. By default, an element is not implicitly potentially render-blocking.

    +

    Fetch priority attributes

    + +

    A fetch priority attribute is an enumerated attribute. The following + table lists the keywords and states for the attribute — the keywords in the left column map to + the states in the cell in the second column on the same row as the keyword.

    + + + + + + + + +
    Keyword + State + Description +
    high + high + Signals a high-priority fetch relative to other + resources with the same destination. +
    low + low + Signals a low-priority fetch relative to other + resources with the same destination. +
    auto + auto + Signals automatic determination of fetch priority + relative to other resources with the same destination. +
    + +

    The attribute's missing value default and + invalid value default are both the + auto state.

    +

    Common DOM interfaces

    Reflecting content attributes in IDL attributes

    @@ -14369,6 +14410,7 @@ interface HTMLBaseElement : HTMLElement {
    blocking
    color
    disabled
    +
    fetchpriority
    Also, the title attribute has special semantics on this element.
    Accessibility considerations:
    @@ -14395,6 +14437,7 @@ interface HTMLLinkElement : HTMLElement { [CEReactions] attribute DOMString referrerPolicy; [SameObject, PutForwards=value] readonly attribute DOMTokenList blocking; [CEReactions] attribute boolean disabled; + [CEReactions] attribute DOMString fetchPriority; // also has obsolete members }; @@ -14729,6 +14772,14 @@ interface HTMLLinkElement : HTMLElement {
    <link disabled rel="alternate stylesheet" href="css/pooh">
    +

    The fetchpriority attribute is a fetch + priority attribute that is intended for use with external resource links, where it is used to set the priority used when fetching and processing the linked + resource.

    +

    @@ -14740,7 +14791,7 @@ interface HTMLLinkElement : HTMLElement { rel, sizes, type, - blocking and + blocking, and disabled each must reflect the respective content attributes of the same name.

    @@ -14761,6 +14812,11 @@ interface HTMLLinkElement : HTMLElement { reflect the referrerpolicy content attribute, limited to only known values.

    +

    The fetchPriority IDL attribute must + reflect the fetchpriority content + attribute, limited to only known values.

    +

    The imageSrcset IDL attribute must reflect the imagesrcset content attribute.

    @@ -14977,6 +15033,9 @@ interface HTMLLinkElement : HTMLElement {
  • Set request's client to options's environment.

  • +
  • Set request's priority to + options's fetch priority.

  • +
  • Return request.

  • @@ -15054,6 +15113,10 @@ interface HTMLLinkElement : HTMLElement {
    on document ready (default null)
    Null or an algorithm accepting a Document
    + +
    fetch priority (default auto)
    +
    A fetch priority attribute state

    A link processing options has a HTMLLinkElement : HTMLElement {

    cryptographic nonce metadata
    The current value of el's [[CryptographicNonce]] internal slot
    + +
    fetch priority
    +
    the state of el's fetchpriority + content attribute
    @@ -15271,6 +15338,12 @@ interface HTMLLinkElement : HTMLElement {
  • If attribs["type"] exists, then set options's type to attribs["type"].

  • + +
  • If attribs["fetchpriority"] + exists and is an ASCII case-insensitive match for + a fetch priority attribute keyword, then set options's fetch priority to that fetch priority + attribute keyword.

  • @@ -25820,14 +25893,19 @@ document.body.appendChild(wbr);
  • Let referrer policy be the current state of el's referrerpolicy attribute.

  • +
  • Let fetch priority be the current state of el's fetchpriority attribute.

  • +
  • Let options be a script fetch options whose cryptographic nonce is cryptographic nonce, integrity metadata is integrity metadata, parser metadata is "not-parser-inserted", credentials mode is credentials - mode, and referrer - policy is referrer policy.

  • + mode, referrer + policy is referrer policy, and fetch priority is + fetch priority.

  • Fetch a modulepreload module script graph given url, @@ -26161,11 +26239,10 @@ document.body.appendChild(wbr);

    The preload keyword indicates that the user agent will preemptively fetch and cache the specified resource according to the potential destination given by the - as attribute (and the priority associated with the corresponding destination), as it is highly likely that the user - will require this resource for the current navigation.

    + as attribute, and the priority given by the fetchpriority attribute, as it is highly likely that the + user will require this resource for the current navigation.

    User-agents might perform additional operations when a resource is loaded, such as preemptively decoding images or HTMLSourceElement : HTMLElement {

    referrerpolicy
    decoding
    loading
    +
    fetchpriority
    Accessibility considerations:
    If the element has a non-empty alt attribute: HTMLImageElement : HTMLElement { [CEReactions] attribute DOMString referrerPolicy; [CEReactions] attribute DOMString decoding; [CEReactions] attribute DOMString loading; + [CEReactions] attribute DOMString fetchPriority; Promise<undefined> decode(); @@ -27913,6 +27992,12 @@ interface HTMLImageElement : HTMLElement { default">invalid value default are both the auto state.

    +

    The fetchpriority attribute is a fetch + priority attribute. Its purpose is to set the priority used when fetching the image.

    +

    The loading attribute is a lazy loading attribute. Its purpose is to indicate the policy for loading images that are outside the viewport.

    @@ -28162,6 +28247,11 @@ interface HTMLImageElement : HTMLElement { IDL attribute must reflect the loading content attribute, limited to only known values.

    +

    The fetchPriority IDL attribute + must reflect the fetchpriority content + attribute, limited to only known values.

    +
  • @@ -29744,6 +29834,10 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ... to the current state of the element's referrerpolicy attribute.

    +
  • Set request's priority to the current state of the + element's fetchpriority attribute.

  • +
  • Let delay load event be true if the img's lazy loading attribute is in the Eager state, or if scripting is disabled for the img, and @@ -30639,6 +30733,10 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...referrer policy to the current state of the element's referrerpolicy attribute.

  • +
  • Set request's priority to the current state of the element's fetchpriority attribute.

  • +
  • Let response be the result of fetching request.

  • @@ -59851,6 +59949,7 @@ interface HTMLDialogElement : HTMLElement {
    integrity
    referrerpolicy
    blocking
    +
    fetchpriority
    Accessibility considerations:
    For authors.
    @@ -59871,6 +59970,7 @@ interface HTMLScriptElement : HTMLElement { [CEReactions] attribute DOMString integrity; [CEReactions] attribute DOMString referrerPolicy; [SameObject, PutForwards=value] readonly attribute DOMTokenList blocking; + [CEReactions] attribute DOMString fetchPriority; static boolean supports(DOMString type); @@ -59966,8 +60066,9 @@ interface HTMLScriptElement : HTMLElement { data-x="attr-script-async">async, nomodule, defer, crossorigin, integrity, and referrerpolicy attributes must not be specified.

    + data-x="attr-script-integrity">integrity, referrerpolicy, and fetchpriority attributes must not be specified.

    The nomodule attribute is a boolean attribute that prevents a script from being executed in user @@ -60072,14 +60173,21 @@ interface HTMLScriptElement : HTMLElement {

    The blocking attribute is a blocking attribute.

    +

    The fetchpriority attribute is a + fetch priority attribute. Its purpose is to set the priority used when fetching the script.

    +

    Changing the src, type, nomodule, async, defer, crossorigin, integrity, and referrerpolicy attributes dynamically has no direct effect; these - attributes are only used at specific times described below.

    + data-x="attr-script-integrity">integrity, referrerpolicy, and fetchpriority attributes dynamically has no direct + effect; these attributes are only used at specific times described below.

    @@ -60096,6 +60204,11 @@ interface HTMLScriptElement : HTMLElement { reflect the referrerpolicy content attribute, limited to only known values.

    +

    The fetchPriority IDL attribute must + reflect the fetchpriority + content attribute, limited to only known values.

    +

    The crossOrigin IDL attribute must reflect the crossorigin content attribute, limited to @@ -60655,6 +60768,9 @@ o............A....e

  • Let referrer policy be the current state of el's referrerpolicy content attribute.

  • +
  • Let fetch priority be the current state of el's fetchpriority content attribute.

  • +
  • Let parser metadata be "parser-inserted" if el is parser-inserted, and "not-parser-inserted" otherwise.

  • @@ -60665,8 +60781,10 @@ o............A....e integrity metadata, parser metadata is parser metadata, credentials mode is module script - credentials mode, and referrer - policy is referrer policy.

    + credentials mode, referrer + policy is referrer policy, and fetch priority is fetch + priority.

  • Let settings object be el's node document's relevant settings object.

  • @@ -76119,14 +76237,16 @@ END:VCARD
  • If it is editable, the node behaves as if it were non-editable.

  • -
  • The user agent may ignore the node for the purposes of find-in-page.

  • +
  • The user agent should ignore the node for the purposes of find-in-page.

  • -

    Inert nodes generally cannot be focused. Inert nodes that are commands will also get disabled.

    +

    Inert nodes generally cannot be focused, and user agents do not expose the inert + nodes to accessibility APIs or assistive technologies. Inert nodes that are commands will become inoperable to users, in the manner described + above.

    -

    User agents may allow the user to override the restrictions on search and text selection, - however.

    +

    User agents may allow the user to override the restrictions on find-in-page and + text selection, however.

    By default, a node is not inert.

    @@ -76156,19 +76276,84 @@ END:VCARD don't otherwise escape inertness (such as modal dialogs) are to be made inert by the user agent.

    -

    By default, there is no persistent visual indication of a subtree being inert. - Authors are encouraged to clearly mark what parts of their document are active and which are - inert, to avoid user confusion. In particular, it is worth remembering that not all users can see - all parts of a page at once; for example, users of screen readers, users on small devices or with - magnifiers, and even users using particularly small windows might not be able to see the active - part of a page and might get frustrated if inert sections are not obviously inert. For individual - controls, the disabled attribute is probably more +

    An inert subtree should not contain any content or controls which are critical to + understanding or using aspects of the page which are not in the inert state. Content in an inert + subtree will not be perceivable by all users, or interactive. Authors should not specify elements + as inert unless the content they represent are also visually obscured in some way. In most cases, + authors should not specify the inert attribute on individual form controls. In these + instances, the disabled attribute is probably more appropriate.

    -

    The inert IDL attribute must reflect - the content attribute of the same name.

    +
    +

    The following example shows how to mark partially loaded content, visually obscured by a + "loading" message, as inert.

    + +
    <section aria-labelledby=s1>
    +  <h3 id=s1>Population by City</h3>
    +  <div class=container>
    +    <div class=loading><p>Loading...</p></div>
    +    <div inert>
    +      <form>
    +        <fieldset>
    +          <legend>Date range</legend>
    +          <div>
    +            <label for=start>Start</label>
    +            <input type=date id=start>
    +          </div>
    +          <div>
    +            <label for=end>End</label>
    +            <input type=date id=end>
    +          </div>
    +          <div>
    +            <button>Apply</button>
    +          </div>
    +        </fieldset>
    +      </form>
    +      <table>
    +        <caption>From 20-- to 20--</caption>
    +        <thead>
    +          <tr>
    +            <th>City</th>
    +            <th>State</th>
    +            <th>20-- Population</th>
    +            <th>20-- Population</th>
    +            <th>Percentage change</th>
    +          </tr>
    +        </thead>
    +        <tbody>
    +          <!-- ... -->
    +        </tbody>
    +      </table>
    +    </div>
    +  </div>
    +</section>
    + Screenshot of Population by City content with an overlaid loading message which visually obscures the form controls and data table which have not fully rendered, and thus are in the inert state. +

    The "loading" overlay obscures the inert content, making it visually apparent that the inert + content is not presently accessible. Notice that the heading and "loading" text are not + descendants of the element with the inert attribute. This will ensure this text is + accessible to all users, while the inert content cannot be interacted with by anyone.

    +
    + +
    +

    By default, there is no persistent visual indication of an element or its subtree being + inert. Appropriate visual styles for such content is often context-dependent. For instance, an + inert off-screen navigation panel would not require a default style, as its off-screen position + visually obscures the content. Similarly, a modal dialog element's backdrop will + serve as the means to visually obscure the inert content of the web page, rather than styling + the inert content specifically.

    + +

    However, for many other situations authors are strongly encouraged to clearly mark what parts + of their document are active and which are inert, to avoid user confusion. In particular, it is + worth remembering that not all users can see all parts of a page at once; for example, users of + screen readers, users on small devices or with magnifiers, and even users using particularly + small windows might not be able to see the active part of a page and might get frustrated if + inert sections are not obviously inert.

    +
    + +

    The inert IDL attribute must reflect + the content attribute of the same name.

    Tracking user activation

    @@ -81346,7 +81531,7 @@ dictionary DragEventInit : MouseEventInit {
  • If oldValue and value are in different states, then run the hide popover algorithm given - element, true, false, and false.

  • + element, true, true, and false.

    @@ -81438,8 +81623,7 @@ dictionary DragEventInit : MouseEventInit { ancestor algorithm given element.

  • Run hide all popovers until given - ancestor's node document, ancestor, false, and - false.

  • + ancestor, false, and true.

  • If originalType is not equal to the value of element's DragEventInit : MouseEventInit { method steps are:

      -
    1. Run the hide popover algorithm given this, true, false, and +

    2. Run the hide popover algorithm given this, true, true, and true.

    To hide a popover given an HTML element element, a boolean focusPreviousElement, a - boolean dontFireEvents, and a boolean throwExceptions:

    + boolean fireEvents, and a boolean throwExceptions:

    1. @@ -81565,8 +81749,7 @@ dictionary DragEventInit : MouseEventInit {
      1. Run hide all popovers until given - element's node document, element, - focusPreviousElement, and dontFireEvents.

      2. + element, focusPreviousElement, and fireEvents.

      3. If element is not in document's auto popover list:

        @@ -81590,7 +81773,7 @@ dictionary DragEventInit : MouseEventInit {
      4. Set element's popover invoker to null.

      5. -

        If dontFireEvents is false:

        +

        If fireEvents is true:

        1. Fire an event named DragEventInit : MouseEventInit {

        2. Set element's popover visibility state to hidden.

        3. -
        4. If dontFireEvents is false, then queue a popover toggle event task +

        5. If fireEvents is true, then queue a popover toggle event task given element, "open", and "closed".

        6. @@ -81649,19 +81832,21 @@ dictionary DragEventInit : MouseEventInit {
          1. If this's popover visibility state is showing, and force is not present or false, then - run the hide popover algorithm given this, true, false, and + run the hide popover algorithm given this, true, true, and true.

          2. Otherwise, if force is not present or true, then run show popover given this and true.

          -

          To hide all popovers until, given a - Document document, an HTML element or - null endpoint, a boolean focusPreviousElement, and a boolean - dontFireEvents:

          +

          To hide all popovers until, given an HTML element or Document endpoint, a boolean + focusPreviousElement, and a boolean fireEvents:

            +
          1. Let document be endpoint if endpoint is a Document, + otherwise endpoint's node document.

          2. +
          3. Let closeAllOpenPopovers be an algorithm which performs the following steps:

            @@ -81674,7 +81859,7 @@ dictionary DragEventInit : MouseEventInit {
            1. Run the hide popover algorithm given popover, - focusPreviousElement, dontFireEvents, and false.

            2. + focusPreviousElement, fireEvents, and false.

            3. Set popover to document's topmost auto popover.

            4. @@ -81712,8 +81897,8 @@ dictionary DragEventInit : MouseEventInit {
              1. Run the hide popover algorithm given document's auto - popover list's last element, focusPreviousElement, - dontFireEvents, and false.

              2. + popover list's last element, focusPreviousElement, fireEvents, and + false.

            @@ -82003,7 +82188,7 @@ dictionary DragEventInit : MouseEventInit {
          4. If popover's popover visibility state is showing and the result of running check popover validity given popover and true is true, then run the hide popover - algorithm given popover, true, false, and false.

          5. + algorithm given popover, true, true, and false.

          6. Otherwise, if popover's popover visibility state is DragEventInit : MouseEventInit { a popover whose popover attribute is in the auto state will close the popover.

            -

            Canceling popovers: When Document has a +

            Canceling popovers: when Document has a topmost auto popover showing, user agents may provide a user interface that, upon activation, queues an element task on the user interaction task source given topmost auto popover to run the hide - popover algorithm given the topmost auto popover, true, and false.

            + popover algorithm given the topmost auto popover, true, true, and false.

            To light dismiss open popovers, given an Event event:

            @@ -82125,8 +82310,7 @@ dictionary DragEventInit : MouseEventInit {
          7. Set document's popover pointerdown target to null.

          8. If sameTarget is true, then run hide - all popovers until given ancestor's node document, - ancestor, false, and false.

          9. + all popovers until given ancestor, false, and true.

        @@ -86159,8 +86343,6 @@ dictionary WindowPostMessageOptions : StructuredSeri
      6. If current is null, then return null.

      7. -
      8. If current's disowned is true, then return null.

      9. -
      10. If current's opener browsing context is null, then return null.

      11. @@ -86173,7 +86355,7 @@ dictionary WindowPostMessageOptions : StructuredSeri
        1. If the given value is null and this's browsing context is non-null, then set this's browsing - context's disowned to true.

        2. + context's opener browsing context to null.

        3. If the given value is non-null, then return ? OrdinaryDefineOwnProperty(this, "opener", { @@ -86182,18 +86364,14 @@ dictionary WindowPostMessageOptions : StructuredSeri

        -

        If a browsing context's disowned is true, its window.opener attribute is null. That prevents scripts in the - browsing context from changing any properties of its opener browsing - context's Window object (i.e., the Window object from which the - browsing context was created).

        +

        Setting window.opener to null clears the opener + browsing context reference. In practice, this prevents future scripts from accessing their + opener browsing context's Window object.

        -

        Otherwise, if a browsing context's disowned is false, then scripts - in that browsing context can use window.opener to - change properties of its opener browsing context's Window object. For - example, a script running in the browsing context can change the value of window.opener.location, causing the opener browsing context to - navigate to a completely different document.

        +

        By default, scripts can access their opener browsing context's + Window object through the window.opener getter. + E.g., a script can set window.opener.location, causing the opener + browsing context to navigate.

        The parent getter steps @@ -89363,8 +89541,6 @@ interface BeforeUnloadEvent : Event {

      12. An opener origin at creation, an origin or null, initially null.

        -
      13. A disowned boolean, initially false.

      14. -
      15. An is popup boolean, initially false.

        @@ -91323,7 +91499,7 @@ location.href = '#foo';
      16. historyEntry's document's browsing context is not an auxiliary browsing - context whose disowned is false; and

      17. + context whose opener browsing context is non-null; and

      18. historyEntry's document's origin is not navigable's

      19. targetEntry's document's browsing context is not an auxiliary browsing - context whose disowned is false; and

      20. + context whose opener browsing context is non-null; and

      21. targetEntry's document's origin is not oldOrigin

      22. @@ -97224,6 +97400,12 @@ document.querySelector("button").addEventListener("click", bound);

        The boolean value of render-blocking used for the initial fetch and for fetching any imported modules. Unless otherwise stated, its value is false.

        + +
        fetch priority
        + +

        The priority used for the + initial fetch

        +
  • Recall that via the import() feature, parser metadata is "not-parser-inserted", credentials mode is "same-origin", and same-origin", referrer policy is the empty - string.

    + string, and fetch priority + is "auto".

    Given a request request and a script fetch options options, we define:

    @@ -97252,9 +97435,11 @@ document.querySelector("button").addEventListener("click", bound); data-x="concept-request-parser-metadata">parser metadata to options's parser metadata, its referrer policy to options's referrer policy, and its + data-x="concept-script-fetch-options-referrer-policy">referrer policy, its render-blocking to options's - render-blocking.

    + render-blocking, and its + priority to options's + fetch priority.

    set up the module script request

    Set request's cryptographic nonce @@ -97267,16 +97452,19 @@ document.querySelector("button").addEventListener("click", bound); data-x="concept-request-credentials-mode">credentials mode to options's credentials mode, its referrer policy to options's referrer policy, and its + data-x="concept-script-fetch-options-referrer-policy">referrer policy, its render-blocking to options's - render-blocking.

    + render-blocking, and its + priority to options's + fetch priority.

    For any given script fetch options options, the descendant script fetch options are a new script fetch options whose items all have the same values, except for the integrity metadata, which is instead the - empty string.

    + empty string, and the fetch + priority, which is instead "auto".


    @@ -97781,8 +97969,10 @@ document.querySelector("button").addEventListener("click", bound); parser metadata is "not-parser-inserted", credentials mode is credentials - mode, and referrer - policy is the empty string.

    + mode, referrer + policy is the empty string, and fetch priority is "auto".

  • Fetch a single module script given url, fetch client settings @@ -103490,10 +103680,12 @@ enum DOMParserSupportedType { data-x="concept-script-fetch-options-credentials">credentials mode is initiating script's fetch options's credentials - mode, and referrer + mode, referrer policy is initiating script's fetch options's referrer policy.

    + data-x="concept-script-fetch-options-referrer-policy">referrer policy, and fetch priority is "auto".

    The effect of these options ensures that the string compilation done by setTimeout() and External { height; referrerpolicy; decoding; - loading + loading; + fetchpriority HTMLImageElement @@ -128699,7 +128892,8 @@ interface External { integrity; blocking; color; - disabled + disabled; + fetchpriority HTMLLinkElement @@ -129056,7 +129250,8 @@ interface External { crossorigin; integrity; referrerpolicy; - blocking + blocking; + fetchpriority HTMLScriptElement @@ -130196,6 +130391,15 @@ interface External { "previous"; "search"; "send" + + fetchpriority + img; + link; + script + Sets the priority for fetches initiated by the element + "auto"; + "high"; + "low" for label