Skip to content

Commit fa0c100

Browse files
committed
Add speculation rules prefetch
This ports the relevant text from https://wicg.github.io/nav-speculation/speculation-rules.html, with minor improvements and additions. Notable changes from that document: * Allows treating prerender rules as prefetch rules. * Allows the presence of target_hint (a prerender-specific speculation rule key), but ignores it. * Follows the precedent set by import maps a bit more closely in how it integrates with the script processing model. Normatively, it fires error events on the script element for the few things that cause complete parsing failures. * Adds conformance requirements for speculation rules JSON documents, following the precedent set by import maps. * Adds explicit callouts for when the implementation may report warnings for parsing failures, following the precedent set by import maps. * Fixes a few minor bugs in the parsing algorithms. E.g., the previous text did not correctly deal with how CSS selector parsing returned a list, or called the slightly wrong algorithm for parsing URL patterns. * Simplified the processing model for the Speculation-Rules HTTP header. The previous text added various concepts around pending fetches and periodic implementation-defined processing of those fetches, all designed to allow the implementation to de-prioritize these fetches in favor of other things that happen during loading. This version instead explicitly allows an implementation-defined wait time and uses a separate task source which user agents can deprioritize.
1 parent 08ea4a7 commit fa0c100

File tree

1 file changed

+1080
-17
lines changed

1 file changed

+1080
-17
lines changed

0 commit comments

Comments
 (0)