Intent to Ship: Speculation rules: tag field

141 views
Skip to first unread message

Domenic Denicola

unread,
Mar 31, 2025, 11:26:09 PMMar 31
to blink-dev

Contact emails

robe...@chromium.orgdom...@chromium.org

Explainer

https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md

Specification

https://wicg.github.io/nav-speculation/speculation-rules.html

Summary

This enables developers to add tag field to speculation rules. This optional field can be used to track the source of speculation rules, e.g. to treat them differently at an intermediary server. Any tags associated with a speculation will be sent with the Sec-Speculation-Tags header.



Blink component

Internals>Preload

Search tags

speculationrulesprerenderingprefetch

TAG review

https://github.com/w3ctag/design-reviews/issues/721 The TAG is generally dissatisfied with speculation rules, claiming that the syntax is too complicated. As such, we don't believe asking for review of this additional small field would be fruitful.

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The entire speculative loading feature is a progressive enhancement, so in general risks are low in this area.



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1172) Mozilla is neutral on speculation rules syntax in general (https://github.com/mozilla/standards-positions/issues/620), although positive on prefetching. We opened a new request for this specific feature to ensure we captured any of their input.

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/54) WebKit has not yet responded to our 2022 request for a position on speculation rules in general. We have updated the thread to point them to this latest addition anyway.

Web developers: Positive (https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md#stakeholder-feedback)

Other signals:

Activation

Due to how new fields in speculation rules are interpreted in older versions of Chromium, using this field on the rule level can cause the rules to be dropped. A workaround is using it on the ruleset level only during this transition period. https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md#location-of-the-tags-within-the-json



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

We would like to use the presence of ruleset-level tags to improve DevTools's existing display of speculation rules rulesets: https://issues.chromium.org/issues/393408589



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

General support for speculation rules on WebView remains unavailable. There is nothing specific about this feature that is incompatible with WebView, however, so if speculation rules starts working on WebView this feature will "just work".



Is this feature fully tested by web-platform-tests?

Yes

We have a large set of tests planned, and are actively landing them now. They should show up in https://wpt.fyi/results/speculation-rules?label=master&label=experimental&aligned&q=tags once they have landed. (Some already have but more are on the way.)



Flag name on about://flags

None

Finch feature name

SpeculationRulesTag

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/381687257

Adoption expectation

Major platforms start using this feature shortly after it launches in Chromium.

Adoption plan

Reaching out to major platforms directly, via already-established communications channels such as the spec issue tracker.

Estimated milestones

Shipping on desktop136
Shipping on Android136

We are hoping to launch this in 136, despite the branch cut already having passed, by backporting the flag-flipping CL or (less preferred) turning it on using Finch. If there are concerns that prevent approvals from coming in quickly enough for this, then we might slip to 137.


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6503137340555264?gate=5074975754813440

Links to previous Intent discussions

Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra8a%2B4uVDq1V1ZvrkUj9Jg3tbnbnqNXfeHhxZSSMj1mXVg%40mail.gmail.com


This intent message was generated by Chrome Platform Status.

Yoav Weiss (@Shopify)

unread,
Apr 1, 2025, 3:51:45 AMApr 1
to Domenic Denicola, blink-dev
LGTM1



On Tue, Apr 1, 2025 at 5:25 AM Domenic Denicola <dom...@chromium.org> wrote:

Contact emails

robe...@chromium.orgdom...@chromium.org

Explainer

https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md

Specification

https://wicg.github.io/nav-speculation/speculation-rules.html

Summary

This enables developers to add tag field to speculation rules. This optional field can be used to track the source of speculation rules, e.g. to treat them differently at an intermediary server. Any tags associated with a speculation will be sent with the Sec-Speculation-Tags header.



Blink component

Internals>Preload

Search tags

speculationrulesprerenderingprefetch

TAG review

https://github.com/w3ctag/design-reviews/issues/721 The TAG is generally dissatisfied with speculation rules, claiming that the syntax is too complicated. As such, we don't believe asking for review of this additional small field would be fruitful.

TAG review status

Not applicable

Risks



Interoperability and Compatibility

The entire speculative loading feature is a progressive enhancement, so in general risks are low in this area.



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1172) Mozilla is neutral on speculation rules syntax in general (https://github.com/mozilla/standards-positions/issues/620), although positive on prefetching. We opened a new request for this specific feature to ensure we captured any of their input.

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/54) WebKit has not yet responded to our 2022 request for a position on speculation rules in general. We have updated the thread to point them to this latest addition anyway.

Web developers: Positive (https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md#stakeholder-feedback)

With my web dev hat on, this is an extremely useful addition, and would enable different backend treatment for different kinds of speculation. That's critical for real-life deployment of speculation with different levels of confidence.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra-VUWfzu%3Dm_3OVc03b6%2BZ9CCn5vHi0-xWKK75RfKqbfSg%40mail.gmail.com.

Alex Russell

unread,
Apr 2, 2025, 11:21:08 AMApr 2
to blink-dev, Yoav Weiss, blink-dev, Domenic Denicola
LGTM2, with some disappointment on two fronts:

 - why do we keep doing this these JSON-ish declarative forms without adding any sort of DOM? It's maddening.
 - we're backing into many things that effectively map to headers. Why not just add a "headers" sub-field to the structure and allow a full set, ala the Request() ctor?

Both of those can happen as compatible additions, so not going to block here.

Best,

Alex

On Tuesday, April 1, 2025 at 12:51:45 AM UTC-7 Yoav Weiss wrote:
LGTM1



On Tue, Apr 1, 2025 at 5:25 AM Domenic Denicola <dom...@chromium.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Vladimir Levin

unread,
Apr 2, 2025, 11:21:58 AMApr 2
to blink-dev, Alex Russell, Yoav Weiss, blink-dev, Domenic Denicola
LGTM3

Chris Harrelson

unread,
Apr 2, 2025, 11:22:22 AMApr 2
to Alex Russell, blink-dev, Yoav Weiss, Domenic Denicola
LGTM3

On Wed, Apr 2, 2025 at 8:21 AM Alex Russell <sligh...@chromium.org> wrote:
LGTM2, with some disappointment on two fronts:

 - why do we keep doing this these JSON-ish declarative forms without adding any sort of DOM? It's maddening.
 - we're backing into many things that effectively map to headers. Why not just add a "headers" sub-field to the structure and allow a full set, ala the Request() ctor?

Both of those can happen as compatible additions, so not going to block here.

Best,

Alex

On Tuesday, April 1, 2025 at 12:51:45 AM UTC-7 Yoav Weiss wrote:
LGTM1



On Tue, Apr 1, 2025 at 5:25 AM Domenic Denicola <dom...@chromium.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/72ddd0c7-43ce-40f2-b30d-ac5b1d9c6d88n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages