From 60692146d3bbea2ce20f567c4c09867f91487f14 Mon Sep 17 00:00:00 2001 From: Patrick Meenan Date: Wed, 3 Sep 2025 15:03:35 -0400 Subject: [PATCH 1/4] Added support for link rel=compression-dictionary --- source | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/source b/source index a205205ec16..704e87d7238 100644 --- a/source +++ b/source @@ -15557,6 +15557,7 @@ interface HTMLLinkElement : HTMLElement { the processing model, and are supported by the user agent. The possible supported tokens are alternate, + compression-dictionary, dns-prefetch, expect, icon, @@ -26186,6 +26187,7 @@ document.body.appendChild(wbr);

Keywords that are body-ok affect whether link elements are allowed in the body. The body-ok keywords are + compression-dictionary, dns-prefetch, modulepreload, pingback, @@ -26251,6 +26253,17 @@ document.body.appendChild(wbr); Gives the permalink for the nearest ancestor section. + + compression-dictionary + External Resource + not allowed + Yes + · + Specifies that the user agent should preemptively fetch and cache the + target resource as it is likely to be useful as a compression dictionary for future + fetches. RFC9842 + + dns-prefetch External Resource @@ -26672,6 +26685,94 @@ document.body.appendChild(wbr); Link Relation. RFC6596

+
Link type "compression-dictionary"
+ +

The compression-dictionary keyword may be used + with link elements. This keyword creates an external + resource link. This keyword is body-ok.

+ +

The compression-dictionary keyword indicates + that preemptively fetching and caching the specified resource + or same-site document is likely to be beneficial, as it is highly likely that the user will + be able to this resource as a compression dictionary for future + fetches. RFC9842

+ +

There is no default type for resources given by the + compression-dictionary keyword.

+ +

The appropriate times to fetch and + process this type of link are:

+ + + +

The fetch and process the linked resource algorithm for compression-dictionary links, given a + link element el, is as follows:

+ +
    +
  1. If el's href attribute's value is the + empty string, then return.

  2. + +
  3. Let options be the result of creating link options from el.

  4. + +
  5. If the state of el's crossorigin + content attribute is not set, set options's + crossorigin to + Anonymous.

  6. + +
  7. Set options's destination to + the empty string.

  8. + +
  9. Let request be the result of creating a + link request given options.

  10. + +
  11. If request is null, then return.

  12. + +
  13. Set request's initiator to + "compression-dictionary".

  14. + +
  15. +

    Let processCompressionDictionaryResponse be the following steps given a response response and null, failure, or a + byte sequence bytesOrNull:

    + +
      +
    1. If response is a network error, fire an event named error at el.

    2. + +
    3. Otherwise, fire an event named load at el.

    4. +
    +
  16. + +
  17. The user agent should fetch request, with + processResponseConsumeBody set to + processCompressionDictionaryResponse. User agents may delay the fetching of + request to prioritize other requests that are necessary for the current document.

  18. +
+ +

The process a link header steps for this type of linked resource are to do + nothing.

+ +
Link type "dns-prefetch"
@@ -147865,6 +147966,9 @@ INSERT INTERFACES HERE
[RFC8297]
An HTTP Status Code for Indicating Hints, K. Oku. IETF.
+
[RFC9842]
+
Compression Dictionary Transport, P. Meenan, Y. Weiss. IETF.
+
[SCREENORIENTATION]
Screen Orientation, M. Cáceres. W3C.
From b188167e3aba1ccc9e05259a90bca28b9d6d5e7c Mon Sep 17 00:00:00 2001 From: Patrick Meenan Date: Thu, 4 Sep 2025 11:49:15 -0400 Subject: [PATCH 2/4] Fixed CORS mode processing and http link processing --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 704e87d7238..0ffee874805 100644 --- a/source +++ b/source @@ -26258,7 +26258,7 @@ document.body.appendChild(wbr); External Resource not allowed Yes - · + Yes Specifies that the user agent should preemptively fetch and cache the target resource as it is likely to be useful as a compression dictionary for future fetches. RFC9842 @@ -26732,8 +26732,8 @@ document.body.appendChild(wbr);
  • Let options be the result of creating link options from el.

  • -
  • If the state of el's crossorigin - content attribute is not set, set options's +

  • If options's crossorigin + is no-CORS, set options's crossorigin to Anonymous.

  • From 552c47207e09483e4a3c151e8829ed9294f24c3f Mon Sep 17 00:00:00 2001 From: Patrick Meenan Date: Thu, 4 Sep 2025 11:50:11 -0400 Subject: [PATCH 3/4] Fixed No CORS --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 0ffee874805..ebed6c56f8d 100644 --- a/source +++ b/source @@ -26733,7 +26733,7 @@ document.body.appendChild(wbr); element">creating link options from el.

  • If options's crossorigin - is no-CORS, set options's + is No CORS, set options's crossorigin to Anonymous.

  • From 7e2c16141c5c0891c845292350bbd324bc132287 Mon Sep 17 00:00:00 2001 From: Patrick Meenan Date: Thu, 4 Sep 2025 12:30:00 -0400 Subject: [PATCH 4/4] Fixed link header processing --- source | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/source b/source index ebed6c56f8d..e5889dc7ecc 100644 --- a/source +++ b/source @@ -26721,17 +26721,19 @@ document.body.appendChild(wbr); removed.

    -

    The fetch and process the linked resource algorithm for compression-dictionary links, given a - link element el, is as follows:

    +

    The fetch and process the linked resource steps for this type of linked resource, + given a link element el, are to create link options from el and + to load a compression dictionary given the result and el.

    -
      -
    1. If el's href attribute's value is the - empty string, then return.

    2. +

      The process a link header step for this type of linked resource given a link processing options options are to + load a compression dictionary given options.

      -
    3. Let options be the result of creating link options from el.

    4. +

      To load a compression dictionary given a link processing options + options and optional link element el:

      +
      1. If options's crossorigin is No CORS, set options's crossorigin to @@ -26754,12 +26756,12 @@ document.body.appendChild(wbr); byte sequence bytesOrNull:

          -
        1. If response is a network error,

          If response is a network error and el is set, fire an event named error at el.

        2. -
        3. Otherwise, fire an event named load at el.

        4. +
        5. Otherwise, if el is set, fire an event + named load at el.

      2. @@ -26769,9 +26771,6 @@ document.body.appendChild(wbr); request to prioritize other requests that are necessary for the current document.

      -

      The process a link header steps for this type of linked resource are to do - nothing.

      -
      Link type "dns-prefetch"