[Trusted Types] Implement script src attribute without StringContext. [chromium/src : main]

0 views
Skip to first unread message

Daniel Vogelheim (Gerrit)

unread,
Jun 18, 2025, 2:18:27 PMJun 18
to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
Attention needed from Joey Arhar

Daniel Vogelheim added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Daniel Vogelheim . resolved

Hi Joey, please take a look. I adopted the naming suggestions from our email discussion.

Open in Gerrit

Related details

Attention is currently required from:
  • Joey Arhar
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
Gerrit-Change-Number: 6593311
Gerrit-PatchSet: 9
Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Wed, 18 Jun 2025 18:18:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Joey Arhar (Gerrit)

unread,
Jun 20, 2025, 5:50:53 PMJun 20
to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
Attention needed from Daniel Vogelheim

Joey Arhar added 3 comments

Commit Message
Line 21, Patchset 9 (Latest):This CL should not introduce any behavioural changes. If the updated
Joey Arhar . unresolved

So with this patch, you can now pass a TrustedScriptURL instead of a USVString to the changed IDL methods. That's not observable?

File third_party/blink/renderer/core/html/html_embed_element.cc
Line 249, Patchset 9 (Latest):}
Joey Arhar . unresolved

So it seems like we will start running trusted types checks on this setter without any runtime flag. Is trusted types already enabled by default? Is this change guaranteed to not have any issues? Or does TrustedTypesCheckForScriptURL not do anything different when its passed a USVString?

File third_party/blink/renderer/core/html/html_embed_element.idl
Line 30, Patchset 9 (Latest): [CEReactions, RaisesException=Setter, URL] attribute (TrustedScriptURL or USVString) src;
Joey Arhar . unresolved

Is this the IDL that is agreed on in a spec PR or discussion? If so, want to link to it in the commit description? Is the difference observable from script?

Also, based on the commit message I expected this to remove A StringContext= IDL attribute, but it looks like there isn't one here.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Vogelheim
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Jun 2025 21:50:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Jun 21, 2025, 9:47:15 AMJun 21
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Joey Arhar

    Daniel Vogelheim added 1 comment

    Commit Message
    Line 21, Patchset 9 (Latest):This CL should not introduce any behavioural changes. If the updated
    Joey Arhar . unresolved

    So with this patch, you can now pass a TrustedScriptURL instead of a USVString to the changed IDL methods. That's not observable?

    Daniel Vogelheim

    No, not all. There must be a misunderstanding here somewhere...

    Trusted Types has been default enabled since 2020: https://chromium-review.googlesource.com/c/chromium/src/+/2095548

    In any recent Chrome/Chromium, go to about:blank, and in the DevTools console, do this:

    ```
    const script = document.createElement("script");
    const str = "https://blabla";
    const trusted_script_url = trustedTypes.createPolicy("bla", {createScriptURL: s => s}).createScriptURL(str);

    typeof str; // 'string'
    typeof trusted_script_url; // 'object'
    trusted_script_url; // TrustedScriptURL 'https://blabla'

    script.src = str; // passes.
    script.src = trusted_script_url; // passes.

    // enable TT
    document.head.setHTMLUnsafe(`<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'">`);

    script.src = str; // throws.
    script.src = trusted_script_url; // passes.
    ```

    Note how current Chrome will accept both TrustedScriptURL and a string, and will behave quite differently between those once TT is enabled.

    Here is a WPT test that checks this behaviour (also for HTMLScriptElement src assignment), under various conditions: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/trusted-types/HTMLElement-generic.html;l=28-72 This test continues to pass.


    The code that implements this is generated by the bindings, based on the [StringContext] IDL extended attribute. You can inspect it here: https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_script_element.cc;l=103-131?q=bindings%20HTMLScriptElement%20src%20callback&ss=chromium%2Fchromium%2Fsrc

    Note the type that gets passed to the NativeValueTraits, here: https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/third_party/blink/renderer/bindings/core/v8/v8_html_script_element.cc;l=123;drc=3a5d99f59bc052bf3c578a74ef8d20a79b60ed14

    This, through one more indirection, calls this code: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h;l=570-593;drc=a32603b1d241bc57afade4ee4c7c5e320a722c5b

    Note the Trusted Types check, here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h;l=589-591;drc=a32603b1d241bc57afade4ee4c7c5e320a722c5b

    What my CL does: It implements the exact same check, in the exact same sequence, but as first thing in the receiving code in the DOM, rather than in the Bindings just before DOM is called. Note that it *removes* the [StringContext] annotation. I guess one could say that this, more or less, "inlines" the check into hand-written code, rather than relying on the IDL compiler.

    I need to do this, because 1) the HTML working group didn't want to standardize [StringContext], and 2) in some cases -- but not here -- the HTML working group has decided that other checks get run first, and that will be observable. In order to implement the latter thing, I need to have the check in "regular" code first, because I can't do that with the bindings compiler.

    I indeed very much expect this CL (and all others in the same sequence) to be unobservable.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Sat, 21 Jun 2025 13:46:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jun 23, 2025, 1:27:21 PMJun 23
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Daniel Vogelheim

    Joey Arhar added 2 comments

    Commit Message
    Joey Arhar

    Thanks for the explanation!

    Note that it removes the [StringContext] annotation.

    I still don't see "StringContext" anywhere in the diff

    File third_party/blink/renderer/core/html/html_embed_element.cc
    Joey Arhar . resolved

    So it seems like we will start running trusted types checks on this setter without any runtime flag. Is trusted types already enabled by default? Is this change guaranteed to not have any issues? Or does TrustedTypesCheckForScriptURL not do anything different when its passed a USVString?

    Joey Arhar

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Vogelheim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Comment-Date: Mon, 23 Jun 2025 17:27:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Vogelheim <voge...@chromium.org>
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Jun 23, 2025, 2:52:10 PMJun 23
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Joey Arhar

    Daniel Vogelheim added 1 comment

    Commit Message
    Daniel Vogelheim

    My bad, it's a typedef: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl;l=7

    The current type is `ScriptURLString` (for `src`, `data`, `codeBase`) which is a typedef for `[StringContext=TrustedScriptURL] USVString`, and `ScriptString` (for `text`) which is a typedef for `[StringContext=TrustedScript] DOMString`.

    I should have said, e.g. for HTMLScriptElement.src, that it replaces `ScriptURLString`, which is a typedef for `[StringContext=TrustedScriptURL] USVString`, with `(TrustedScriptURL or USVString)`. `StringContext` indeed does not literally occur in the diff. However, the [StringContext] IDL extended attribute is currently applied to those attributes; and is no longer after this change. The same check is now run explicitly. The before and after types should accept the exact same set of JS objects, and exhibit the same behaviour.

    Definition ScriptURLString:
    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl;l=7

    Definition ScriptString:
    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/trustedtypes/trusted_script.idl;l=7

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Mon, 23 Jun 2025 18:51:51 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jun 24, 2025, 1:55:40 PMJun 24
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Daniel Vogelheim

    Joey Arhar voted and added 2 comments

    Votes added by Joey Arhar

    Code-Review+1

    2 comments

    Commit Message
    Line 21, Patchset 9 (Latest):This CL should not introduce any behavioural changes. If the updated
    Joey Arhar . resolved
    Joey Arhar

    Ah I see now StringContext is used now, I didn't know that typedefs existed like this in idl. thanks!

    File third_party/blink/renderer/core/html/html_embed_element.idl
    Line 30, Patchset 9 (Latest): [CEReactions, RaisesException=Setter, URL] attribute (TrustedScriptURL or USVString) src;
    Joey Arhar . unresolved

    Is this the IDL that is agreed on in a spec PR or discussion? If so, want to link to it in the commit description? Is the difference observable from script?

    Also, based on the commit message I expected this to remove A StringContext= IDL attribute, but it looks like there isn't one here.

    Joey Arhar

    I still think it would be nice to link to some of the spec discussion, but I don't insist if it is also linked somewhere in the attached bug.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Vogelheim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Comment-Date: Tue, 24 Jun 2025 17:55:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Jul 1, 2025, 8:25:19 AM (14 days ago) Jul 1
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Joey Arhar

    Daniel Vogelheim added 1 comment

    File third_party/blink/renderer/core/html/html_embed_element.idl
    Line 30, Patchset 9: [CEReactions, RaisesException=Setter, URL] attribute (TrustedScriptURL or USVString) src;
    Joey Arhar . unresolved

    Is this the IDL that is agreed on in a spec PR or discussion? If so, want to link to it in the commit description? Is the difference observable from script?

    Also, based on the commit message I expected this to remove A StringContext= IDL attribute, but it looks like there isn't one here.

    Joey Arhar

    I still think it would be nice to link to some of the spec discussion, but I don't insist if it is also linked somewhere in the attached bug.

    Daniel Vogelheim

    Yeah, that's a good callout. Should have done this wright away... :)

    I've added:

    These should explain in good detail what I'm trying to do here, including links to spec (etc.).

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 10
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Tue, 01 Jul 2025 12:25:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Jul 1, 2025, 9:57:30 AM (14 days ago) Jul 1
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Joey Arhar

    Daniel Vogelheim added 1 comment

    File third_party/blink/renderer/core/html/html_embed_element.idl
    Line 30, Patchset 9: [CEReactions, RaisesException=Setter, URL] attribute (TrustedScriptURL or USVString) src;
    Joey Arhar . resolved

    Is this the IDL that is agreed on in a spec PR or discussion? If so, want to link to it in the commit description? Is the difference observable from script?

    Also, based on the commit message I expected this to remove A StringContext= IDL attribute, but it looks like there isn't one here.

    Joey Arhar

    I still think it would be nice to link to some of the spec discussion, but I don't insist if it is also linked somewhere in the attached bug.

    Daniel Vogelheim

    Yeah, that's a good callout. Should have done this wright away... :)

    I've added:

    These should explain in good detail what I'm trying to do here, including links to spec (etc.).

    Daniel Vogelheim

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 10
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Tue, 01 Jul 2025 13:57:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Daniel Vogelheim (Gerrit)

    unread,
    Jul 1, 2025, 9:57:34 AM (14 days ago) Jul 1
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org
    Attention needed from Joey Arhar

    Daniel Vogelheim voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 10
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Tue, 01 Jul 2025 13:57:23 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jul 1, 2025, 10:42:10 AM (14 days ago) Jul 1
    to Daniel Vogelheim, Yoav Weiss (@Shopify), AyeAye, chromium...@chromium.org, gavinp+p...@chromium.org, prerenderi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, hiroshig...@chromium.org, jmedle...@chromium.org, kouhei...@chromium.org

    Chromium LUCI CQ submitted the change

    Unreviewed changes

    9 is the latest approved patch-set.
    No files were changed between the latest approved patch-set and the submitted one.

    Change information

    Commit message:
    [Trusted Types] Implement script src attribute without StringContext.

    The [StringContext=] extendend IDL attribute is a Chrome-specific
    mechanism to implement Trusted Types. TT is currently being integrated
    into the HTML spec, and the spec editors decided against the
    StringContext IDL attribute, and instead specify Trusted Types checks
    "manually" in the spec. In some instances -- but not here -- the
    difference between the IDL-based and the "manual" TT checks is observable, due to the when the TT check is being made.

    This CL re-implements the Trusted Types check of the following properties, without StringContext:
    - HTMLScriptElement, src + text
    - HTMLObjectElement, data + codeBase
    - HTMLEmbedElement, src


    This CL should not introduce any behavioural changes. If the updated
    HTML specs introduces changes relative to Chrome's current behaviour,
    we will implement those semantic changes in a separate CL, behind a
    flag. Here, we only change the mechanism.
    Bug: 330516530
    Change-Id: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Commit-Queue: Daniel Vogelheim <voge...@chromium.org>
    Reviewed-by: Joey Arhar <jar...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1481044}
    Files:
    • M third_party/blink/renderer/core/html/html_embed_element.cc
    • M third_party/blink/renderer/core/html/html_embed_element.h
    • M third_party/blink/renderer/core/html/html_embed_element.idl
    • M third_party/blink/renderer/core/html/html_object_element.cc
    • M third_party/blink/renderer/core/html/html_object_element.h
    • M third_party/blink/renderer/core/html/html_object_element.idl
    • M third_party/blink/renderer/core/html/html_script_element.cc
    • M third_party/blink/renderer/core/html/html_script_element.h
    • M third_party/blink/renderer/core/html/html_script_element.idl
    • M third_party/blink/renderer/core/speculation_rules/speculation_rule_set_test.cc
    Change size: M
    Delta: 10 files changed, 123 insertions(+), 22 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Joey Arhar
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I270b035e69b46b02ea1a73b0b1b8407d50c60408
    Gerrit-Change-Number: 6593311
    Gerrit-PatchSet: 11
    Gerrit-Owner: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages