Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process early hints (103 responses) #7675

Merged
merged 13 commits into from
Apr 14, 2022
Merged

Process early hints (103 responses) #7675

merged 13 commits into from
Apr 14, 2022

Conversation

noamr
Copy link
Contributor

@noamr noamr commented Mar 3, 2022

Closes #7598
Closes w3c/preload#114

(See WHATWG Working Mode: Changes for more details.)


/browsing-the-web.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/links.html ( diff )
/references.html ( diff )
/semantics.html ( diff )

@noamr noamr changed the title Early hints WIP: Early hints Mar 3, 2022
@noamr
Copy link
Contributor Author

noamr commented Mar 3, 2022

FYI @yoavweiss @annevk @bashi @domenic

How it works:

  • navigation params keeps a list of uncommitted preloads (initially null, reset with cross-origin redirect)
  • when early hints come from FETCH, those preloads are initiated. The policy container is initialized from the 103 response and the reserved client.
  • When the document is created, the preload requests are re-checked against the document's policy container, and added to the document's map of preloads. Responses that are already complete are also re-checked with the policy container and reported to resource timing
  • Responses that come after the document has been created are checked against the document's policy container before being handed off to the consumer.
  • Timing reported to Resource Timing needs to be coarsened if the new document has a different cross-origin isolated policy from the reserved client.

Early hints provide several interesting race scenarios - we should make sure those scenarios are well WPTed...

@yoavweiss
Copy link
Contributor

/cc @ddragana

aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 15, 2022
The HTML/Fetch standards would likely say that preloaded resources
are preserved during same origin redirects [1]. Don't clear
NavigationEarlyHintsManager to align the discussion.

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I410509a8a3a142eb2ef57c5bfb39d2729be84a16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3521146
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#981351}
@noamr noamr changed the title WIP: Early hints Process early hints (103 responses) Mar 16, 2022
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 24, 2022
The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 24, 2022
The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 24, 2022
The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 24, 2022
The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 25, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] #33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 28, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] #33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 28, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] web-platform-tests/wpt#33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 28, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] #33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 28, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] #33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}
@noamr
Copy link
Contributor Author

noamr commented Mar 28, 2022

@domenic this is ready to be reviewed.

@domenic domenic added addition/proposal New features or enhancements topic: navigation labels Mar 28, 2022
source Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated
@@ -14270,6 +14274,177 @@ interface <dfn interface>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
<li><p>Let <var>attribs</var> be <var>linkObject</var>["<code
data-x="">target_attributes</code>"].</p></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is not used.

source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Outdated
</ol>
</li>
<li><p>Return <var>links</var>.</p></li>
</ol>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the XXX box about non-preload link types up to below this algorithm. Or maybe even above it?

source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
@noamr noamr force-pushed the early-hints branch 2 times, most recently from 9d7aecc to 5818eee Compare March 31, 2022 14:22
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 2, 2022
…ight when consumed, a=testonly

Automatic update from web-platform-tests
Add WPT for Early Hints preload is in-flight when consumed

The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}

--

wpt-commits: 850fd2b4dbf5c21ebb649f6d889caa140b8b29db
wpt-pr: 33337
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 2, 2022
…ad finish timings, a=testonly

Automatic update from web-platform-tests
Add WPTs for different Early Hints preload finish timings

The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] web-platform-tests/wpt#33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}

--

wpt-commits: f88ac14ebaf9206cc08af481c2332b8dbef11a59
wpt-pr: 33365
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Apr 5, 2022
…ight when consumed, a=testonly

Automatic update from web-platform-tests
Add WPT for Early Hints preload is in-flight when consumed

The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}

--

wpt-commits: 850fd2b4dbf5c21ebb649f6d889caa140b8b29db
wpt-pr: 33337
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Apr 5, 2022
…ad finish timings, a=testonly

Automatic update from web-platform-tests
Add WPTs for different Early Hints preload finish timings

The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] web-platform-tests/wpt#33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}

--

wpt-commits: f88ac14ebaf9206cc08af481c2332b8dbef11a59
wpt-pr: 33365
@annevk
Copy link
Member

annevk commented Apr 7, 2022

The final commit message here should make clear this ends up closing #7598.

annevk added a commit to whatwg/fetch that referenced this pull request Apr 7, 2022
Allow specifications to pass an algorithm to fetch to process 103 Early Hints responses.

See whatwg/html#7598 for the overall approach.

Corresponding HTML PR: whatwg/html#7675.

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
@noamr
Copy link
Contributor Author

noamr commented Apr 11, 2022

@domenic anything left? I've added examples, and the FETCH PR has landed.

@domenic
Copy link
Member

domenic commented Apr 12, 2022

Sorry, still digging myself out from the backlog from my week off, but I promise this has made it near the top of the pile.

source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
source Outdated Show resolved Hide resolved
source Show resolved Hide resolved
source Show resolved Hide resolved
Notably fixing "otherwise false" to be "otherwise 'pre-media'", and linking <link> attributes. Otherwise mostly rewrapping.
@domenic domenic merged commit f99550b into whatwg:main Apr 14, 2022
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
The test page sends an Early Hints with a resource preload. The response
of the resource is delayed until the final response consumes the
resource.

The purpose of this test is to make sure the resource is added to the
document's map of preloads [1].

[1] whatwg/html#7675

Bug: 1305896
Change-Id: I39371b41860190936991799fb6457f142e7ffef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545997
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984778}
NOKEYCHECK=True
GitOrigin-RevId: 0234f19605f0b7cefa3b6ed6f82c912fa0023595
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
The test scenarios are:
* 103 -> start preload -> preload finished -> 200 -> response body.
* 103 -> start preload -> (preload inflight) -> 200 -> preload finished
  -> response body.

The purpose of these tests is to make sure the resource is added to the
preload map of the document [1]. Also refer to [2] for the motivation.

[1] whatwg/html#7675
[2] web-platform-tests/wpt#33076 (comment)

Bug: 1305896
Change-Id: Id0ba4748f6493bc2c78be6de5769b4d16ce9092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3552176
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#985847}
NOKEYCHECK=True
GitOrigin-RevId: 071f6139eefcc90470dccbe5d70d8449b58daf12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements topic: navigation
Development

Successfully merging this pull request may close these issues.

103 Early Hints response processing during navigation Interaction of 103 and CSP
4 participants