Implement external <script type="speculationrules"> [chromium/src : main]

3 views
Skip to first unread message

Viktoria Zlatinova (Gerrit)

unread,
Dec 18, 2025, 1:34:16 PM12/18/25
to Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
Attention needed from Viktoria Zlatinova

Message from Viktoria Zlatinova

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Viktoria Zlatinova
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
Gerrit-Change-Number: 7034064
Gerrit-PatchSet: 9
Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 18:33:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Viktoria Zlatinova (Gerrit)

unread,
Dec 30, 2025, 10:04:14 AM12/30/25
to Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org

Viktoria Zlatinova added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Viktoria Zlatinova . resolved

PTAL when you have a chance, thanks!

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
Gerrit-Change-Number: 7034064
Gerrit-PatchSet: 9
Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Comment-Date: Tue, 30 Dec 2025 15:03:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Jan 1, 2026, 11:57:39 PMJan 1
to Viktoria Zlatinova, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
Attention needed from Viktoria Zlatinova

Yoav Weiss (@Shopify) added 1 comment

Patchset-level comments
Yoav Weiss (@Shopify) . resolved

I think you'd need to start an HTML spec discussion on this feature, ideally backed by use-cases it would solve.

You probably also should put the feature behind a runtime-enabled flag [1], and start the relevant intent process [2].

[1] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/RuntimeEnabledFeatures.md
[2] https://www.chromium.org/blink/launching-features/

Open in Gerrit

Related details

Attention is currently required from:
  • Viktoria Zlatinova
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
Gerrit-Change-Number: 7034064
Gerrit-PatchSet: 9
Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
Gerrit-Comment-Date: Fri, 02 Jan 2026 04:57:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Viktoria Zlatinova (Gerrit)

unread,
Jan 3, 2026, 7:20:24 AMJan 3
to Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
Attention needed from Yoav Weiss (@Shopify)

Viktoria Zlatinova added 1 comment

Patchset-level comments
File-level comment, Patchset 9:
Yoav Weiss (@Shopify) . unresolved

I think you'd need to start an HTML spec discussion on this feature, ideally backed by use-cases it would solve.

You probably also should put the feature behind a runtime-enabled flag [1], and start the relevant intent process [2].

[1] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/RuntimeEnabledFeatures.md
[2] https://www.chromium.org/blink/launching-features/

Viktoria Zlatinova

Thanks! Will add a flag and start the intent process.

I created a PR for the HTML spec here: https://github.com/whatwg/html/pull/11697
Some extra discussion here: https://github.com/whatwg/html/issues/11123#issuecomment-3336819191

Original issue in WICG: https://github.com/WICG/nav-speculation/issues/348

I will collect the use cases and continue the discussion in the HTML spec to ensure there is cross-browser support

Open in Gerrit

Related details

Attention is currently required from:
  • Yoav Weiss (@Shopify)
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 10
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Sat, 03 Jan 2026 12:20:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Jan 29, 2026, 2:01:38 PMJan 29
    to Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Takashi Toyoshima and Yoav Weiss (@Shopify)

    Viktoria Zlatinova added 1 comment

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    Viktoria Zlatinova . resolved

    PTAL when you have a chance, thank you!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Takashi Toyoshima
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 11
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 19:01:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Feb 3, 2026, 9:19:08 AMFeb 3
    to Viktoria Zlatinova, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Takashi Toyoshima added 8 comments

    Commit Message
    Line 11, Patchset 11 (Latest):https://chromestatus.com/feature/4868908869877760
    Takashi Toyoshima . unresolved

    Any link to the CSP spec's algorithm change?
    Also nice to have a direct link to the speculation rules side GitHub issue that discusses this.

    File third_party/blink/renderer/core/frame/csp/content_security_policy.cc
    Line 921, Patchset 11 (Latest): // Speculation rules from HTTP headers are exempt from CSP, unlike speculation
    Takashi Toyoshima . unresolved

    Sorry, I could not remember details on what I changed a few years ago, but it's great if you note how this affect inline speculation rules cases.

    File third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc
    Line 62, Patchset 11 (Latest):enum class OptOutRuleSetType { kInline, kExternalScript, kHttpHeader };
    Takashi Toyoshima . unresolved

    `kInlineScript` for consistency

    File third_party/blink/renderer/core/script/script_loader.h
    Line 111, Patchset 11 (Latest):
    Takashi Toyoshima . unresolved

    Let's keep this protected and make the caller class a friend class.

    File third_party/blink/renderer/core/script/script_loader.cc
    Line 841, Patchset 11 (Parent): element_document.AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
    mojom::blink::ConsoleMessageSource::kJavaScript,
    mojom::blink::ConsoleMessageLevel::kError,
    "External speculation rules are not yet supported."));
    Takashi Toyoshima . unresolved

    Maybe it's good to keep this in the disabled code path and say 'not yet enabled'?

    File third_party/blink/renderer/core/speculation_rules/external_speculation_rules_client.h
    Line 1, Patchset 11 (Latest):// Copyright 2024 The Chromium Authors
    Takashi Toyoshima . unresolved

    2026

    File third_party/blink/renderer/core/speculation_rules/external_speculation_rules_client.cc
    Line 1, Patchset 11 (Latest):// Copyright 2024 The Chromium Authors
    Takashi Toyoshima . unresolved

    ditto

    File third_party/blink/renderer/core/speculation_rules/speculation_rule_set.h
    Line 87, Patchset 11 (Latest): bool IsFromScript() const;
    Takashi Toyoshima . unresolved

    Can we have a clear comment to say that this includes both inline and external cases?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Viktoria Zlatinova
    • Yoav Weiss (@Shopify)
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Feb 2026 14:18:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Feb 3, 2026, 5:42:50 PMFeb 3
    to Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Takashi Toyoshima and Yoav Weiss (@Shopify)

    Viktoria Zlatinova added 7 comments

    File third_party/blink/renderer/core/frame/csp/content_security_policy.cc
    Line 921, Patchset 11: // Speculation rules from HTTP headers are exempt from CSP, unlike speculation
    Takashi Toyoshima . resolved

    Sorry, I could not remember details on what I changed a few years ago, but it's great if you note how this affect inline speculation rules cases.

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/loader/document_loader_auto_speculation_rules_test.cc
    Line 62, Patchset 11:enum class OptOutRuleSetType { kInline, kExternalScript, kHttpHeader };
    Takashi Toyoshima . resolved

    `kInlineScript` for consistency

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/script/script_loader.h
    Line 111, Patchset 11:
    Takashi Toyoshima . resolved

    Let's keep this protected and make the caller class a friend class.

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/script/script_loader.cc
    Line 841, Patchset 11 (Parent): element_document.AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>(
    mojom::blink::ConsoleMessageSource::kJavaScript,
    mojom::blink::ConsoleMessageLevel::kError,
    "External speculation rules are not yet supported."));
    Takashi Toyoshima . resolved

    Maybe it's good to keep this in the disabled code path and say 'not yet enabled'?

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/speculation_rules/external_speculation_rules_client.h
    Line 1, Patchset 11:// Copyright 2024 The Chromium Authors
    Takashi Toyoshima . resolved

    2026

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/speculation_rules/external_speculation_rules_client.cc
    Line 1, Patchset 11:// Copyright 2024 The Chromium Authors
    Takashi Toyoshima . resolved

    ditto

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/speculation_rules/speculation_rule_set.h
    Line 87, Patchset 11: bool IsFromScript() const;
    Takashi Toyoshima . resolved

    Can we have a clear comment to say that this includes both inline and external cases?

    Viktoria Zlatinova

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Takashi Toyoshima
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 13
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Feb 2026 22:42:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Feb 4, 2026, 6:38:27 AMFeb 4
    to Viktoria Zlatinova, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Takashi Toyoshima added 3 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Takashi Toyoshima . resolved

    This change for the content_security_policy.cc is related to the CSP spec's algorithm and requires Mike's another review to check if we need another spec change.

    Commit Message

    Any link to the CSP spec's algorithm change?
    Also nice to have a direct link to the speculation rules side GitHub issue that discusses this.

    Takashi Toyoshima

    thank you!

    Line 18, Patchset 13 (Latest):- CSP spec change: https://github.com/w3c/webappsec-csp/pull/776
    Takashi Toyoshima . unresolved

    This seems to be an upstreaming patch that ported my original CSP spec change for the inline script, and wasn't for an external script?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Viktoria Zlatinova
    • Yoav Weiss (@Shopify)
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 11:37:57 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Feb 4, 2026, 5:03:56 PMFeb 4
    to Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Takashi Toyoshima and Yoav Weiss (@Shopify)

    Viktoria Zlatinova added 1 comment

    Commit Message
    Takashi Toyoshima . unresolved

    This seems to be an upstreaming patch that ported my original CSP spec change for the inline script, and wasn't for an external script?

    Viktoria Zlatinova

    I created a branch based off of this active PR to include the external script speculation rules case: https://github.com/domenic/webappsec-csp/pull/1. I'll follow up with folks on GitHub to get that reviewed. Can implementation continue in parallel?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Takashi Toyoshima
    • Yoav Weiss (@Shopify)
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 22:03:46 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Takashi Toyoshima (Gerrit)

    unread,
    Feb 5, 2026, 6:42:56 AMFeb 5
    to Viktoria Zlatinova, Mike West, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Mike West, Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Takashi Toyoshima added 2 comments

    Patchset-level comments
    Takashi Toyoshima . unresolved

    +mkwst for a sign-off around the CSP changes

    Commit Message
    Takashi Toyoshima . unresolved

    This seems to be an upstreaming patch that ported my original CSP spec change for the inline script, and wasn't for an external script?

    Viktoria Zlatinova

    I created a branch based off of this active PR to include the external script speculation rules case: https://github.com/domenic/webappsec-csp/pull/1. I'll follow up with folks on GitHub to get that reviewed. Can implementation continue in parallel?

    Takashi Toyoshima

    So, can you at least add TODO comments against changes in content_security_policy.cc?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Mike West
    • Viktoria Zlatinova
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 13
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Feb 2026 11:42:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mike West (Gerrit)

    unread,
    Feb 5, 2026, 7:23:19 AMFeb 5
    to Viktoria Zlatinova, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Mike West added 5 comments

    Patchset-level comments
    Mike West . resolved

    Thanks! I'll defer to loading folks for most of this, but I do have some questions about the CSP integration below:

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Line 177, Patchset 13 (Latest): check_header_type, options.initiator_info.name)) {
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    File third_party/blink/renderer/core/speculation_rules/speculation_rule_set.h
    Line 62, Patchset 13 (Latest): bool is_from_external_script);
    Mike West . unresolved
    File third_party/blink/renderer/core/speculation_rules/speculation_rules_header.cc
    Line 151, Patchset 13 (Parent): network::mojom::blink::RequestDestination::kSpeculationRules);
    Mike West . unresolved

    Dropping this will change the `Sec-Fetch-Destination` header sent with the request, as well as the request's `destination` which is web-accessible via the `Request` object. Can you help me understand why you're removing the annotation?

    File third_party/blink/web_tests/external/wpt/speculation-rules/external-speculation-rules.html
    Line 44, Patchset 13 (Latest):</script>
    Mike West . unresolved

    It would be ideal to add web platform tests verifying the CSP integration.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Feb 2026 12:23:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Feb 6, 2026, 2:16:17 PMFeb 6
    to Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Mike West, Takashi Toyoshima and Yoav Weiss (@Shopify)

    Viktoria Zlatinova added 6 comments

    Patchset-level comments
    File-level comment, Patchset 9:
    Yoav Weiss (@Shopify) . resolved

    I think you'd need to start an HTML spec discussion on this feature, ideally backed by use-cases it would solve.

    You probably also should put the feature behind a runtime-enabled flag [1], and start the relevant intent process [2].

    [1] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/platform/RuntimeEnabledFeatures.md
    [2] https://www.chromium.org/blink/launching-features/

    Viktoria Zlatinova

    Thanks! Will add a flag and start the intent process.

    I created a PR for the HTML spec here: https://github.com/whatwg/html/pull/11697
    Some extra discussion here: https://github.com/whatwg/html/issues/11123#issuecomment-3336819191

    Original issue in WICG: https://github.com/WICG/nav-speculation/issues/348

    I will collect the use cases and continue the discussion in the HTML spec to ensure there is cross-browser support

    Viktoria Zlatinova

    Done

    File-level comment, Patchset 13:
    Takashi Toyoshima . resolved

    +mkwst for a sign-off around the CSP changes

    Viktoria Zlatinova

    Done

    Commit Message
    Line 18, Patchset 13:- CSP spec change: https://github.com/w3c/webappsec-csp/pull/776
    Takashi Toyoshima . resolved

    This seems to be an upstreaming patch that ported my original CSP spec change for the inline script, and wasn't for an external script?

    Viktoria Zlatinova

    I created a branch based off of this active PR to include the external script speculation rules case: https://github.com/domenic/webappsec-csp/pull/1. I'll follow up with folks on GitHub to get that reviewed. Can implementation continue in parallel?

    Takashi Toyoshima

    So, can you at least add TODO comments against changes in content_security_policy.cc?

    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    File third_party/blink/renderer/core/speculation_rules/speculation_rule_set.h
    Line 62, Patchset 13: bool is_from_external_script);
    Mike West . resolved
    Viktoria Zlatinova

    Done

    File third_party/blink/renderer/core/speculation_rules/speculation_rules_header.cc
    Line 151, Patchset 13 (Parent): network::mojom::blink::RequestDestination::kSpeculationRules);
    Mike West . unresolved

    Dropping this will change the `Sec-Fetch-Destination` header sent with the request, as well as the request's `destination` which is web-accessible via the `Request` object. Can you help me understand why you're removing the annotation?

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Mike West
    • Takashi Toyoshima
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 15
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Feb 2026 19:16:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    Comment-In-Reply-To: Mike West <mk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mike West (Gerrit)

    unread,
    Feb 9, 2026, 3:59:43 AMFeb 9
    to Viktoria Zlatinova, Antonio Sartori, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Mike West added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Viktoria Zlatinova
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 15
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Antonio Sartori <antonio...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Feb 2026 08:59:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Feb 12, 2026, 3:04:13 PMFeb 12
    to Viktoria Zlatinova, Antonio Sartori, Mike West, Takashi Toyoshima, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Hiroshige Hayashizaki added 1 comment

    File third_party/blink/renderer/core/speculation_rules/speculation_rules_header.cc
    Line 151, Patchset 13 (Parent): network::mojom::blink::RequestDestination::kSpeculationRules);
    Mike West . unresolved

    Dropping this will change the `Sec-Fetch-Destination` header sent with the request, as well as the request's `destination` which is web-accessible via the `Request` object. Can you help me understand why you're removing the annotation?

    Viktoria Zlatinova

    I moved this part to SpeculationRulesResource, as it is shared by the HTTP header and external script cases: https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/loader/resource/speculation_rules_resource.cc#:~:text=resource_request.SetRequestContext,%3A%3AkSpeculationRules)%3B

    Hiroshige Hayashizaki

    Basically setting the `resource_request` should be the responsibility of the callers of `*Resource::Fetch()`, so I feel it's better to place here.

    Also the current patchset uses `SpeculationRulesResource` from `SpeculationRulesHeader::StartFetches()` and `ExternalSpeculationRulesClient` separately, but these two paths should be further merged (e.g. Lines 141-146 etc.), to ensure external speculation rules are loaded in the same way by Link header and by <script>.

    So, How about further deduplicating the code here and at ScriptLoader and `ExternalSpeculationRulesClient` with `SpeculationRulesHeader::StartFetches()`, `SpeculationRuleLoader`?

    e.g. introduce a common helper like
    ```
    LoadExternalSpeculationRules(bunch of params...) {
    ... Line 133-165 here, plus necessary modification to accept parameters that differs between Link header and <script> ...
    ... ResourceRequest creation and modification are all done here ...
    }
    ```

    and call `LoadExternalSpeculationRules()` here and from ScriptLoader.

    Gerrit-Comment-Date: Thu, 12 Feb 2026 20:04:03 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Feb 12, 2026, 3:16:08 PMFeb 12
    to Viktoria Zlatinova, Antonio Sartori, Mike West, Takashi Toyoshima, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Viktoria Zlatinova and Yoav Weiss (@Shopify)

    Hiroshige Hayashizaki added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Gerrit-Comment-Date: Thu, 12 Feb 2026 20:15:57 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Feb 24, 2026, 6:39:27 PMFeb 24
    to Antonio Sartori, Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki, Mike West and Yoav Weiss (@Shopify)

    Viktoria Zlatinova voted and added 3 comments

    Votes added by Viktoria Zlatinova

    Commit-Queue+1

    3 comments

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    File third_party/blink/renderer/core/speculation_rules/speculation_rules_header.cc
    Line 151, Patchset 13 (Parent): network::mojom::blink::RequestDestination::kSpeculationRules);
    Mike West . unresolved

    Dropping this will change the `Sec-Fetch-Destination` header sent with the request, as well as the request's `destination` which is web-accessible via the `Request` object. Can you help me understand why you're removing the annotation?

    Viktoria Zlatinova

    I moved this part to SpeculationRulesResource, as it is shared by the HTTP header and external script cases: https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/loader/resource/speculation_rules_resource.cc#:~:text=resource_request.SetRequestContext,%3A%3AkSpeculationRules)%3B

    Hiroshige Hayashizaki

    Basically setting the `resource_request` should be the responsibility of the callers of `*Resource::Fetch()`, so I feel it's better to place here.

    Also the current patchset uses `SpeculationRulesResource` from `SpeculationRulesHeader::StartFetches()` and `ExternalSpeculationRulesClient` separately, but these two paths should be further merged (e.g. Lines 141-146 etc.), to ensure external speculation rules are loaded in the same way by Link header and by <script>.

    So, How about further deduplicating the code here and at ScriptLoader and `ExternalSpeculationRulesClient` with `SpeculationRulesHeader::StartFetches()`, `SpeculationRuleLoader`?

    e.g. introduce a common helper like
    ```
    LoadExternalSpeculationRules(bunch of params...) {
    ... Line 133-165 here, plus necessary modification to accept parameters that differs between Link header and <script> ...
    ... ResourceRequest creation and modification are all done here ...
    }
    ```

    and call `LoadExternalSpeculationRules()` here and from ScriptLoader.

    Viktoria Zlatinova

    Further deduped this code in `SpeculationRuleLoader`. Some of the response handling is also different between the header and script case so I kept those differences - for example, raising DOM events and adding the rules to script loader for script case, and keeping the console messages for header case.

    File third_party/blink/web_tests/external/wpt/speculation-rules/external-speculation-rules.html
    Line 44, Patchset 13:</script>
    Mike West . resolved

    It would be ideal to add web platform tests verifying the CSP integration.

    Viktoria Zlatinova

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Mike West
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 21
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Antonio Sartori <antonio...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Tue, 24 Feb 2026 23:39:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mike West (Gerrit)

    unread,
    Feb 27, 2026, 2:22:03 AMFeb 27
    to Viktoria Zlatinova, Antonio Sartori, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki and Viktoria Zlatinova

    Mike West added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    Mike West

    Please do come back to the CSP spec discussion in https://github.com/w3c/webappsec-csp/pull/776. I'd like to get that worked out before landing an implementation. cc Antonio

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Viktoria Zlatinova
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Feb 2026 07:21:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Mike West <mk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Mar 3, 2026, 9:28:27 PMMar 3
    to Viktoria Zlatinova, Antonio Sartori, Mike West, Takashi Toyoshima, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Viktoria Zlatinova

    Hiroshige Hayashizaki added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    Mike West

    Please do come back to the CSP spec discussion in https://github.com/w3c/webappsec-csp/pull/776. I'd like to get that worked out before landing an implementation. cc Antonio

    Hiroshige Hayashizaki

    I posted https://github.com/whatwg/html/pull/11697#issuecomment-3994806128 for clarifying the scope to be resolved before landing (or shipping) this feature.

    Anyway the implementation will be anyway separate for separate issues:
    This CL (current patch set) is for [1] in https://github.com/whatwg/html/pull/11697#issuecomment-3994806128, applying `script-src`, while [2] and [3] will anyway need separate CLs.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Viktoria Zlatinova
    Gerrit-Comment-Date: Wed, 04 Mar 2026 02:28:17 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Mar 23, 2026, 12:55:22 PM (11 days ago) Mar 23
    to Antonio Sartori, Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki and Mike West

    Viktoria Zlatinova added 2 comments

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    Mike West

    Please do come back to the CSP spec discussion in https://github.com/w3c/webappsec-csp/pull/776. I'd like to get that worked out before landing an implementation. cc Antonio

    Hiroshige Hayashizaki

    I posted https://github.com/whatwg/html/pull/11697#issuecomment-3994806128 for clarifying the scope to be resolved before landing (or shipping) this feature.

    Anyway the implementation will be anyway separate for separate issues:
    This CL (current patch set) is for [1] in https://github.com/whatwg/html/pull/11697#issuecomment-3994806128, applying `script-src`, while [2] and [3] will anyway need separate CLs.

    Viktoria Zlatinova

    Thanks Hiroshige and Mike! Per the latest plan discussed in https://github.com/whatwg/html/pull/11697, can we proceed with this CL?

    File third_party/blink/renderer/core/speculation_rules/speculation_rules_header.cc
    Line 151, Patchset 13 (Parent): network::mojom::blink::RequestDestination::kSpeculationRules);
    Mike West . resolved

    Dropping this will change the `Sec-Fetch-Destination` header sent with the request, as well as the request's `destination` which is web-accessible via the `Request` object. Can you help me understand why you're removing the annotation?

    Viktoria Zlatinova

    I moved this part to SpeculationRulesResource, as it is shared by the HTTP header and external script cases: https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/loader/resource/speculation_rules_resource.cc#:~:text=resource_request.SetRequestContext,%3A%3AkSpeculationRules)%3B

    Hiroshige Hayashizaki

    Basically setting the `resource_request` should be the responsibility of the callers of `*Resource::Fetch()`, so I feel it's better to place here.

    Also the current patchset uses `SpeculationRulesResource` from `SpeculationRulesHeader::StartFetches()` and `ExternalSpeculationRulesClient` separately, but these two paths should be further merged (e.g. Lines 141-146 etc.), to ensure external speculation rules are loaded in the same way by Link header and by <script>.

    So, How about further deduplicating the code here and at ScriptLoader and `ExternalSpeculationRulesClient` with `SpeculationRulesHeader::StartFetches()`, `SpeculationRuleLoader`?

    e.g. introduce a common helper like
    ```
    LoadExternalSpeculationRules(bunch of params...) {
    ... Line 133-165 here, plus necessary modification to accept parameters that differs between Link header and <script> ...
    ... ResourceRequest creation and modification are all done here ...
    }
    ```

    and call `LoadExternalSpeculationRules()` here and from ScriptLoader.

    Viktoria Zlatinova

    Further deduped this code in `SpeculationRuleLoader`. Some of the response handling is also different between the header and script case so I kept those differences - for example, raising DOM events and adding the rules to script loader for script case, and keeping the console messages for header case.

    Viktoria Zlatinova

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Mike West
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 22
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Antonio Sartori <antonio...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Comment-Date: Mon, 23 Mar 2026 16:55:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    Comment-In-Reply-To: Mike West <mk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mike West (Gerrit)

    unread,
    Mar 27, 2026, 3:55:32 AM (8 days ago) Mar 27
    to Viktoria Zlatinova, Antonio Sartori, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Antonio Sartori, Hiroshige Hayashizaki and Viktoria Zlatinova

    Mike West added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    Mike West

    Please do come back to the CSP spec discussion in https://github.com/w3c/webappsec-csp/pull/776. I'd like to get that worked out before landing an implementation. cc Antonio

    Hiroshige Hayashizaki

    I posted https://github.com/whatwg/html/pull/11697#issuecomment-3994806128 for clarifying the scope to be resolved before landing (or shipping) this feature.

    Anyway the implementation will be anyway separate for separate issues:
    This CL (current patch set) is for [1] in https://github.com/whatwg/html/pull/11697#issuecomment-3994806128, applying `script-src`, while [2] and [3] will anyway need separate CLs.

    Viktoria Zlatinova

    Thanks Hiroshige and Mike! Per the latest plan discussed in https://github.com/whatwg/html/pull/11697, can we proceed with this CL?

    Mike West

    +Antonio, as it doesn't look to me as though that conversation on the spec has resolved yet.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Antonio Sartori
    • Hiroshige Hayashizaki
    • Viktoria Zlatinova
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 22
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Mar 2026 07:55:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Mike West <mk...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Antonio Sartori (Gerrit)

    unread,
    Mar 27, 2026, 9:57:34 AM (7 days ago) Mar 27
    to Viktoria Zlatinova, Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Hiroshige Hayashizaki and Viktoria Zlatinova

    Antonio Sartori added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Mike West . unresolved

    This parameter's purpose isn't clear to me. Can you help me understand the scenarios in which checking the request's context/destination wouldn't be enough?

    Viktoria Zlatinova

    Currently the context/destination are the same for external script speculation rules and HTTP header speculations rules, but CSP doesn't apply to the HTTP header case. Using the initiator here to continue exempting the header case - https://chromium.googlesource.com/chromium/src/+/1d7cf351315ad93d53b369011414990a8fde7dbd/third_party/blink/renderer/core/frame/csp/content_security_policy.cc#:~:text=//%20Speculation%20rules%20from,%7D

    Mike West

    Ok. I guess my next question is why it's a good idea to distinguish between those scenarios. :) It looks like Antonio asked about that on the CSP PR as well, and didn't get an answer (https://github.com/w3c/webappsec-csp/pull/776#issuecomment-3327621673). Perhaps you could provide one here?

    Hiroshige Hayashizaki

    As for implementation, if we'd set `mojom::blink::RequestContextType::SCRIPT` for external spec rules from <script>, then the issue is resolved without modification to csp stack?

    +1 to Mike about the spec -- I'll also ask around.

    Viktoria Zlatinova

    Yes, using `mojom::blink::RequestContextType::SCRIPT` resolves the issue without modification to the CSP stack. Updated to this, let me know what you think!

    I can update the CSP/Fetch spec PRs separately to add some reasoning as to why the header case is exempt (with further discussion if needed)

    Mike West

    Please do come back to the CSP spec discussion in https://github.com/w3c/webappsec-csp/pull/776. I'd like to get that worked out before landing an implementation. cc Antonio

    Hiroshige Hayashizaki

    I posted https://github.com/whatwg/html/pull/11697#issuecomment-3994806128 for clarifying the scope to be resolved before landing (or shipping) this feature.

    Anyway the implementation will be anyway separate for separate issues:
    This CL (current patch set) is for [1] in https://github.com/whatwg/html/pull/11697#issuecomment-3994806128, applying `script-src`, while [2] and [3] will anyway need separate CLs.

    Viktoria Zlatinova

    Thanks Hiroshige and Mike! Per the latest plan discussed in https://github.com/whatwg/html/pull/11697, can we proceed with this CL?

    Mike West

    +Antonio, as it doesn't look to me as though that conversation on the spec has resolved yet.

    Antonio Sartori

    My understanding is that we were trying to agree on https://github.com/whatwg/html/pull/11697#issuecomment-4070809909 (adding a new directive speculation-rules-src which falls back to script-src-elem). That makes sense to me (but do others agree with that?)

    If that's the plan, I think it would be good to update the linked spec change (https://github.com/w3c/webappsec-csp/pull/776) which doesn't reflect that, possibly before moving forward with this CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hiroshige Hayashizaki
    • Viktoria Zlatinova
    Gerrit-Comment-Date: Fri, 27 Mar 2026 13:57:18 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoria Zlatinova (Gerrit)

    unread,
    Apr 1, 2026, 5:19:12 PM (2 days ago) Apr 1
    to Antonio Sartori, Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Antonio Sartori, Hiroshige Hayashizaki and Mike West

    Viktoria Zlatinova added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Viktoria Zlatinova

    @Hiroshige @Mike what do you think? I created a PR to w3c here capturing
    these changes based off of Domenic's initial PR:
    https://github.com/w3c/webappsec-csp/pull/808

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Antonio Sartori
    • Hiroshige Hayashizaki
    • Mike West
    Gerrit-Attention: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Wed, 01 Apr 2026 21:19:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Mike West <mk...@chromium.org>
    Comment-In-Reply-To: Antonio Sartori <antonio...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hiroshige Hayashizaki (Gerrit)

    unread,
    Apr 1, 2026, 9:51:26 PM (2 days ago) Apr 1
    to Viktoria Zlatinova, Antonio Sartori, Mike West, Takashi Toyoshima, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Antonio Sartori, Mike West and Viktoria Zlatinova

    Hiroshige Hayashizaki added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Hiroshige Hayashizaki

    My understanding is that we were trying to agree on https://github.com/whatwg/html/pull/11697#issuecomment-4070809909 (adding a new directive speculation-rules-src which falls back to script-src-elem). That makes sense to me (but do others agree with that?)

    I'm checking with the prefetch/preloading folks about CSP changes (e.g. is it OK to apply the new `speculationrules` CSP directive to speculation rules headers that are currently exempted from CSP), which seems to take a couple of weeks.

    Also for clarifying the roadmap:

    It seems we are heading to the non-incremental way (resolving all of [1][2][3] of https://github.com/whatwg/html/pull/11697#issuecomment-3994806128 before proceeding this CL), which will take more time. i.e.

    • [A] landing spec PRs for [2][3] (
    • https://github.com/w3c/webappsec-csp/pull/808 and other related PRs)
    • [B] implementing [1] (the current patch set of this CL)
    • [C] implementing [2][3], i.e. new `speculationrules` directives (none right now?)

    Do we also need to land [C] (which might probably need its separate shipping/experiment process) before shipping external speculation rules?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Antonio Sartori
    • Mike West
    • Viktoria Zlatinova
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I244b22237058e789cbf50718e7cf2540cd757767
    Gerrit-Change-Number: 7034064
    Gerrit-PatchSet: 23
    Gerrit-Owner: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Hiroshige Hayashizaki <hiro...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Viktoria Zlatinova <vizl...@microsoft.com>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 01:50:53 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Antonio Sartori (Gerrit)

    unread,
    Apr 2, 2026, 5:15:54 AM (yesterday) Apr 2
    to Viktoria Zlatinova, Mike West, Takashi Toyoshima, Hiroshige Hayashizaki, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Nate Chapin, prerendering-reviews, Yoav Weiss (@Shopify), kinuko...@chromium.org, jmedle...@chromium.org, edg...@microsoft.com, blink-revie...@chromium.org, antoniosarto...@chromium.org, arthursonzog...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, devtools-re...@chromium.org, gavinp...@chromium.org, gavinp+p...@chromium.org, loading...@chromium.org, mkwst+w...@chromium.org
    Attention needed from Mike West and Viktoria Zlatinova

    Antonio Sartori added 1 comment

    File third_party/blink/renderer/core/loader/base_fetch_context.cc
    Antonio Sartori

    I don't think we need to wait to land everything as long as we have an agreed plan and we go in one direction.

    If the agreed direction is https://github.com/whatwg/html/pull/11697#issuecomment-4070809909 though, then we should put all speculation rules (also headers) behind script-src-elem (which I don't think this CL does). Having a draft PR on the spec is helpful to understand what we are agreeing upon (so updating https://github.com/w3c/webappsec-csp/pull/808 is helpful I believe).

    I think we can ship external speculation rules before landing `speculation-rules-src` - the drawback will be that developers will not be able to use speculation rules headers with strict CSP.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mike West
    • Viktoria Zlatinova
    Gerrit-Comment-Date: Thu, 02 Apr 2026 09:15:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hiroshige Hayashizaki <hiro...@chromium.org>
    Comment-In-Reply-To: Viktoria Zlatinova <vizl...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages