From 66a9f36e7008ab7ef3f1b0e4fa5c0dce6dcdf5ee Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Tue, 23 Oct 2018 14:43:37 +0200 Subject: [PATCH 1/6] Add prefetch processing to HYMLLinkElement processing model, including double-key caching privacy protections --- source | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source b/source index 1d179a3c075..b337f8e4ebd 100644 --- a/source +++ b/source @@ -13735,6 +13735,33 @@ interface HTMLLinkElement : HTMLElement { +
  • +

    If the rel attribute contains the prefetch keyword, then:

    + +
      +
    1. Set request's initiator + to "prefetch".

    2. +
    3. Set request's keep-alive flag + to "true".

    4. +
    5. Let as be the current state of the as + attribute.

    6. +
    7. Set request's destination + to the result of translating + as.

    8. +
    9. If the browser is using both the request's URL and the top-level browsing context's document's origin as cache keys for request, then: +
        +
      1. If request's credentials mode is "include", then return.

      2. +
      3. If request's referrer policy is not "no-referrer", then return.

      4. +
      5. If request's destination is not "document", then return.

      6. +
      7. Set request's redirect mode to "manual".

      8. +
      9. Set request's redirect mode to "manual".

      10. +
      11. Set request's service workers mode to "none".

      12. +
      +
    +
  • +
  • Fetch request.

  • +

    User agents may opt to only try to fetch From d1255bcf694a30e43833e11e64f7bfa33581c67b Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Tue, 23 Oct 2018 16:22:54 +0200 Subject: [PATCH 2/6] Get it to actuall build --- source | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/source b/source index b337f8e4ebd..ffac992f313 100644 --- a/source +++ b/source @@ -2815,6 +2815,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • replaces client id
  • initiator
  • destination
  • +
  • keepalive flag
  • +
  • service-workers mode
  • potential destination
  • translating a potential destination
  • script-like destinations
  • @@ -3188,6 +3190,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute shadow-including descendant, and shadow-including inclusive descendant concepts
  • The first child and next sibling concepts
  • +
  • The origin
  • The document element concept
  • The in a document tree, in a document (legacy), and connected concepts
  • The slot concept, and its name and assigned nodes
  • @@ -13742,22 +13745,33 @@ interface HTMLLinkElement : HTMLElement {
    1. Set request's initiator to "prefetch".

    2. -
    3. Set request's keep-alive flag +

    4. Set request's keepalive flag to "true".

    5. Let as be the current state of the as attribute.

    6. Set request's destination to the result of translating as.

    7. -
    8. If the browser is using both the request's URL and the top-level browsing context's document's origin as cache keys for request, then: -
        -
      1. If request's credentials mode is "include", then return.

      2. -
      3. If request's referrer policy is not "no-referrer", then return.

      4. -
      5. If request's destination is not "document", then return.

      6. -
      7. Set request's redirect mode to "manual".

      8. -
      9. Set request's redirect mode to "manual".

      10. -
      11. Set request's service workers mode to "none".

      12. -
      +
    9. +

      If the browser is using both the request's URL and the + top-level browsing context's active document's origin as cache keys for request, then:

      +
        +
      1. If request's credentials mode is "include", then return. +

      2. +
      3. If request's referrer policy is not "no-referrer", then + return.

      4. +
      5. If request's destination + is not "document", then return.

      6. +
      7. Set request's redirect mode to "manual".

      8. +
      9. Set request's service workers mode to "none".

      10. +
      +
  • Fetch request.

  • From aec29a83aea98b8f6c74840e8ee9f102a9d6b783 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 21 Mar 2019 13:25:11 +0100 Subject: [PATCH 3/6] keepalive to speculative --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index ffac992f313..32ddcfc536b 100644 --- a/source +++ b/source @@ -2815,7 +2815,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • replaces client id
  • initiator
  • destination
  • -
  • keepalive flag
  • +
  • speculative flag
  • service-workers mode
  • potential destination
  • translating a potential destination
  • @@ -13745,7 +13745,7 @@ interface HTMLLinkElement : HTMLElement {
    1. Set request's initiator to "prefetch".

    2. -
    3. Set request's keepalive flag +

    4. Set request's speculative flag to "true".

    5. Let as be the current state of the as attribute.

    6. From 2f70c31288fc739e0e3768a0ef0c58b41714cb47 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 21 Mar 2019 13:35:43 +0100 Subject: [PATCH 4/6] rebased on current link processing model --- source | 83 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/source b/source index 32ddcfc536b..fc8a8af962d 100644 --- a/source +++ b/source @@ -13738,44 +13738,6 @@ interface HTMLLinkElement : HTMLElement {
    -
  • -

    If the rel attribute contains the prefetch keyword, then:

    - -
      -
    1. Set request's initiator - to "prefetch".

    2. -
    3. Set request's speculative flag - to "true".

    4. -
    5. Let as be the current state of the as - attribute.

    6. -
    7. Set request's destination - to the result of translating - as.

    8. -
    9. -

      If the browser is using both the request's URL and the - top-level browsing context's active document's origin as cache keys for request, then:

      -
        -
      1. If request's credentials mode is "include", then return. -

      2. -
      3. If request's referrer policy is not "no-referrer", then - return.

      4. -
      5. If request's destination - is not "document", then return.

      6. -
      7. Set request's redirect mode to "manual".

      8. -
      9. Set request's service workers mode to "none".

      10. -
      -
    10. -
    -
  • -
  • Fetch request.

  • -

    User agents may opt to only try to fetch @@ -24735,6 +24697,49 @@ document.body.appendChild(wbr); keyword.

    +

    The linked resource fetch setup steps for this type of linked resource, given a + link element el and request + request, are:

    + +
      +
    1. Set request's initiator + to "prefetch".

    2. + +
    3. Set request's speculative flag + to "true".

    4. + +
    5. Let as be the current state of el's as attribute.

    6. + +
    7. Set request's destination + to the result of translating + as.

    8. + +
    9. +

      If the browser is using both the request's URL and the + top-level browsing context's active document's origin as cache keys for request, then:

      +
        +
      1. If request's credentials mode is "include", then return + false. +

      2. +
      3. If request's referrer policy is not "no-referrer", then + return false.

      4. +
      5. If request's destination + is not "document", then return false.

      6. +
      7. Set request's redirect mode to "manual".

      8. +
      9. Set request's service workers mode to "none".

      10. +
      +
    10. + +
    11. Return true.

    12. +
    +
    Link type "preload"

    The preload keyword may be used with link @@ -24748,6 +24753,8 @@ document.body.appendChild(wbr); data-x="concept-request-priority">priority associated with the corresponding destination), as it is highly likely that the user +

  • Let as be the current state of el's as attribute.

  • will require this resource for the current navigation. User agents must implement the processing model of the preload keyword described in Preload, as well as in this specification's fetch and process the linked From 796bcd0bc0f41e1332723a2a34c8299e49e8f745 Mon Sep 17 00:00:00 2001 From: Yoav Weiss Date: Thu, 21 Mar 2019 14:18:01 +0100 Subject: [PATCH 5/6] wattsi is happy --- source | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source b/source index fc8a8af962d..1e341e71d3c 100644 --- a/source +++ b/source @@ -24723,8 +24723,7 @@ document.body.appendChild(wbr);
    1. If request's credentials mode is "include", then return - false. -

    2. + false.

    3. If request's referrer policy is not "no-referrer", then return false.

    4. @@ -24753,8 +24752,6 @@ document.body.appendChild(wbr); data-x="concept-request-priority">priority associated with the corresponding destination), as it is highly likely that the user -
    5. Let as be the current state of el's as attribute.

    6. will require this resource for the current navigation. User agents must implement the processing model of the preload keyword described in Preload, as well as in this specification's fetch and process the linked From b9a07a263a68ded56c008e13541b5e8ebe655712 Mon Sep 17 00:00:00 2001 From: Dominic Farolino Date: Fri, 21 Jun 2019 20:38:39 +0900 Subject: [PATCH 6/6] Fix minor outstanding nits --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 1e341e71d3c..cb3ab39286b 100644 --- a/source +++ b/source @@ -24703,10 +24703,10 @@ document.body.appendChild(wbr);
      1. Set request's initiator - to "prefetch".

      2. + to prefetch.

      3. Set request's speculative flag - to "true".

      4. + to true.

      5. Let as be the current state of el's as attribute.