diff --git a/index.bs b/index.bs index b3c0cec..fd1e58a 100644 --- a/index.bs +++ b/index.bs @@ -115,7 +115,7 @@ following specifications and proposals: same-origin or delegated-to cross-origin requests. It also makes sure hints are removed from not delegated-to cross-origin requests after redirections. - - Defines the `Critical-CH` response header, which servers may use to request a reload + - Defines the `Critical-CH` response header, which servers may use to request a restart to include critical Client Hints missing in the initial load. - Integrates those concepts with the [[!HTML]] and [[!FETCH]] specifications, by patching various concepts there. @@ -185,19 +185,21 @@ If an [=url/origin=] is loaded and the server sets an `Accept-CH` header that lists hints not already in the current [=Accept-CH cache=] that means only subsiquent loads of that [=url/origin=] will include the hints. If it's critical that every load (including the first) has the requested Client Hints, -then the server can set a `Critical-CH` header to request a reload. The +then the server can set a `Critical-CH` header to request a restart. The `Critical-CH` header itself does not modify the [=Accept-CH cache=]. -A reload will only occur when a hint in the `Accept-CH` header is both *not in* +A restart will only occur when a hint in the `Accept-CH` header is both *not in* the [=Accept-CH cache=] and *in* the `Critical-CH` header. If hints listed in -the `Critical-CH` header are already in the [=Accept-CH cache=] no reload is +the `Critical-CH` header are already in the [=Accept-CH cache=] no restart is needed as they were sent. If hints listed in the `Critical-CH` header are not -in the `Accept-CH` header a reload would not result in the hints being included +in the `Accept-CH` header a restart would not result in the hints being included anyway. +The restart retries the entire navigation (including any prior redirects). + There MAY be multiple `Critical-CH` headers per-response and sf-lists can be split across lines as long as each line contains at least one token. -When asked if the user agent should reload page for critical client hints given a |settingsObject| and |response|: +When asked if the user agent should restart loading the page for critical client hints given a |settingsObject| and |response|:
  1. If |settingsObject| is a [=non-secure context=], abort these steps. @@ -277,7 +279,9 @@ Navigable {#navigable} Add a new field to [=navigable=]: Navigation response {#navigation-response} @@ -285,19 +289,33 @@ Navigation response {#navigation-response} At [=populating a session history entry=], in step 6 after substep 7 insert the following:
      -
    1. Let |shouldReloadForCriticalClientHints| be `false`. -
    2. If navigable's [=has reloaded for Critical-CH=] is `false`: +
    3. Let |shouldRestartForCriticalClientHints| be `false`. +
    4. If navigable's [=Critical-CH restart time=] is 0:
        -
      1. Let |shouldReloadForCriticalClientHints| be the result of running [$should reload page for critical client hints$] with the [=relevant settings object=] and |response|. +
      2. Let |shouldRestartForCriticalClientHints| be the result of running [$should restart page for critical client hints$] with the [=relevant settings object=] and |response|.
    5. Run [$create or override the cached client hints set$] with the [=relevant settings object=] and |response| as inputs. -
    6. If |shouldReloadForCriticalClientHints| then: +
    7. If |shouldRestartForCriticalClientHints| then: +
        +
      1. Set navigable's [=Critical-CH restart time=] to the [=current high resolution time=]. +
      2. Restart the initial navigation (before any redirects). +
      +
    8. If navigable's [=Critical-CH restart time=] is not 0:
        -
      1. Set navigable's [=has reloaded for Critical-CH=] to `true`. -
      2. reload navigable. +
      3. Set navigationParams's [=Critical-CH restart time=] to be navigable's [=Critical-CH restart time=].
    +Issue(154): Clarify how "Restart the initial navigation (before any redirects)" integrates with the HTML spec. + +At [=navigation params=], append the following: +
    +
    `Critical-CH` restart time
    +
    a {{DOMHighResTimeStamp}} used for [=creating the navigation timing entry=] for the new Document. + This records the time the navigation was restarted to ensure required Client Hint headers will be sent.
    +
    + + Service Worker initialization {#service-worker-init} ----------- At set up a worker environment settings object,