diff --git a/source b/source index 56f8f352ac5..fbb9e2e04db 100644 --- a/source +++ b/source @@ -2429,6 +2429,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

The following terms are defined in Structured Field Values for HTTP: HTMLLinkElement : HTMLElement {

Processing `Link` headers
-

HTTP `Link` headers, if supported, must be assumed to come - before any links in the document, in the order that they were given in the HTTP message. These - headers are to be processed according to the rules given in the relevant specifications.

+

To process link headers given a Document doc, a response response, and a "pre-media" or "media" phase:

-

Registration of relation types in HTTP `Link` - headers is distinct from HTML link types, and thus their semantics can be - different from same-named HTML types.

+
    +
  1. Let rawLinkHeaders be the result of getting, decoding, and splitting + `Link` from response's header list.

  2. + +
  3. +

    For each linkHeader of + rawLinkHeaders:

    + +
      +
    1. Let linkObject be the result of parsing linkHeader.

    2. + +
    3. +

      If linkObject["relation_type"] is not "preload", then continue.

      + +

      Support for additional link types can be added here in the future.

      +
    4. + +
    5. Let attribs be linkObject["target_attributes"].

    6. -

      The processing of `Link` headers, in particular - their influence on a Document's script-blocking style sheet counter, is - not defined. See issue #4224 for - discussion on integrating this into the spec.

      +
    7. Let expectedPhase be "media" if either "srcset", "imagesrcset", or "media" exist in + attribs; otherwise false.

    8. + +
    9. If expectedPhase is not phase, then + continue.

    10. + +
    11. If params includes "media" and + params["media"] does not match the environment, then + continue.

    12. +
    13. Let element be the result of creating an + element given doc, link, and the HTML + namespace.

    14. + +
    15. Set an attribute value for + element using "href" and + linkObject["target_uri"].

    16. + +
    17. Set an attribute value for + element using "rel" and + linkObject["relation_type"].

    18. + +
    19. For each entry in attribs: if + entry[0] is "as", "type", "crossorigin", "imagesizes", "blocking", "integrity", "imagesrcset", or "media", then set an attribute value for + element using entry[0] and entry[1].

    20. + +
    21. Fetch and process + el.

    22. +
    +
  4. +
+ +

The processing of `Link` headers apart from preload, in particular their influence on a Document's + script-blocking style sheet counter, is not defined. See issue #4224 for discussion on integrating + this into the spec.

@@ -88852,6 +88916,10 @@ interface Location { // but see also issue #2900.

+
  • Process link headers given document, + navigationParams's response, and + "pre-media".

  • +
  • Return document.

  • @@ -89065,12 +89133,18 @@ new PaymentRequest(…); // Allowed to use navigationParams.

  • -

    Create an HTML parser and associate it with the document. Each +

    Create an HTML parser and associate it with the document. Each task that the networking task source places on the task queue while fetching runs must then fill the parser's input byte stream with the fetched bytes and cause the HTML parser to perform the appropriate processing of the input stream.

    +

    The first task that the networking task + source places on the task queue while fetching runs must process link + headers given document, navigationParams's response, and "media", after + the task has been procesed by the HTML parser.

    +

    The input byte stream converts bytes into characters for use in the tokenizer. This process relies, in part, on character encoding information found in the real Content-Type metadata of the @@ -89103,6 +89177,12 @@ new PaymentRequest(…); // Allowed to use navigationParams. They must also create a corresponding XML parser.

    +

    The first task that the networking task source + places on the task queue while fetching runs must process link headers + given document, navigationParams's response, and "media", after + the task has been procesed by the XML parser.

    +

    At the time of writing, the XML specification community had not actually yet specified how XML and the DOM interact.

    @@ -89166,6 +89246,12 @@ new PaymentRequest(…); // Allowed to use "navigate-ua-inline" section, and the next three are similar to the navigate-media and navigate-plugin sections; keep them all in sync --> +

    The first task that the networking task source + places on the task queue while fetching runs must process link headers + given document, navigationParams's response, and "media", after + the task has been procesed by the HTML parser.

    +

    When no more bytes are available, the user agent must queue a global task on the networking task source given the newly-created Document's relevant global object for the parser to process the implied EOF character, which eventually causes @@ -89234,6 +89320,10 @@ new PaymentRequest(…); // Allowed to use

  • Set the appropriate attribute of the element host element, as described below, to the address of the image, video, or audio resource.

  • + +
  • Process link headers given document, + navigationParams's response, and + "media".

  • The element host element to create for the media is the element given in @@ -89299,6 +89389,10 @@ new PaymentRequest(…); // Allowed to use

  • Set the src attribute of the embed element to the address of the resource.

  • + +
  • Process link headers given document, + navigationParams's response, and + "media".

  • The term plugin document is used by