[CSS Modules] Implement cloning behavior for shadowrootserializable [chromium/src : main]

0 views
Skip to first unread message

Kurt Catti-Schmidt (Gerrit)

unread,
May 4, 2026, 1:33:54 PM (yesterday) May 4
to Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org

Kurt Catti-Schmidt added 1 comment

File third_party/blink/web_tests/external/wpt/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-clonenode.html
Line 193, Patchset 5 (Latest): // Cross-document importNode: the source host lives in an iframe that
// declares its own import map. importNode must resolve specifiers
// against the destination document's import map (not the source's),
// because ResolveAdoptedStyleSheets uses the cloned root's document.
Kurt Catti-Schmidt . unresolved

This seems kind of dangerous, given that we're re-resolving specifiers without the same import map - should we make sure the documents match (and thus import maps match) before calling `ProcessAdoptedStylesheetAttribute` on the clone? Or is this fine?

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 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: I90057997957ffa78333058d64136b710cda2cbff
Gerrit-Change-Number: 7810476
Gerrit-PatchSet: 5
Gerrit-Owner: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Comment-Date: Mon, 04 May 2026 17:33:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kurt Catti-Schmidt (Gerrit)

unread,
May 4, 2026, 4:04:49 PM (22 hours ago) May 4
to Dan Clark, Mason Freed, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Dan Clark and Mason Freed

Kurt Catti-Schmidt added 2 comments

File third_party/blink/renderer/core/dom/element.cc
Line 1178, Patchset 5 (Latest): // NEW: Re-resolve the shadowrootadoptedstylesheets attribute against the
Kurt Catti-Schmidt . unresolved

Maybe just "Resolve"?

File third_party/blink/web_tests/external/wpt/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-clonenode.html
Line 193, Patchset 5 (Latest): // Cross-document importNode: the source host lives in an iframe that
// declares its own import map. importNode must resolve specifiers
// against the destination document's import map (not the source's),
// because ResolveAdoptedStyleSheets uses the cloned root's document.
Kurt Catti-Schmidt . unresolved

This seems kind of dangerous, given that we're re-resolving specifiers without the same import map - should we make sure the documents match (and thus import maps match) before calling `ProcessAdoptedStylesheetAttribute` on the clone? Or is this fine?

Kurt Catti-Schmidt

After more thought, this is not that different than any other import (although it is less explicit).

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
  • Mason Freed
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: I90057997957ffa78333058d64136b710cda2cbff
Gerrit-Change-Number: 7810476
Gerrit-PatchSet: 5
Gerrit-Owner: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Comment-Date: Mon, 04 May 2026 20:04:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
11:56 AM (2 hours ago) 11:56 AM
to Kurt Catti-Schmidt, Dan Clark, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Dan Clark and Kurt Catti-Schmidt

Mason Freed voted and added 4 comments

Votes added by Mason Freed

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Mason Freed . resolved

This LGTM with just some small nits and comments.

File third_party/blink/renderer/core/dom/element.cc
Line 1178, Patchset 5 (Latest): // NEW: Re-resolve the shadowrootadoptedstylesheets attribute against the
Mason Freed . unresolved

Also, remove `NEW:`. Almost as obvious a tell as the em-dash. 😊

Line 1183, Patchset 5 (Latest): cloned_shadow_root.GetDocument().GetExecutionContext())) {
Mason Freed . unresolved

Perhaps just `factory`?

File third_party/blink/web_tests/external/wpt/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-clonenode.html
Line 228, Patchset 5 (Latest): // "iframe-only" is not a valid specifier in the parent doc's import
// map, so resolution silently skips it (per ResolveAdoptedStyleSheets:
// invalid specifiers are dropped). The clone's adoptedStyleSheets
// should be empty.
Mason Freed . unresolved

This behavior is interesting. I trust that you've thought about it and it's correct. Just might be a bit surprising to developers?

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
  • Kurt Catti-Schmidt
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement 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: I90057997957ffa78333058d64136b710cda2cbff
Gerrit-Change-Number: 7810476
Gerrit-PatchSet: 5
Gerrit-Owner: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Comment-Date: Tue, 05 May 2026 15:56:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Kurt Catti-Schmidt (Gerrit)

unread,
1:06 PM (1 hour ago) 1:06 PM
to Mason Freed, Dan Clark, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Dan Clark

Kurt Catti-Schmidt voted and added 5 comments

Votes added by Kurt Catti-Schmidt

Commit-Queue+1

5 comments

File third_party/blink/renderer/core/dom/element.cc
Line 1178, Patchset 5: // NEW: Re-resolve the shadowrootadoptedstylesheets attribute against the
Mason Freed . resolved

Also, remove `NEW:`. Almost as obvious a tell as the em-dash. 😊

Kurt Catti-Schmidt

I've seen that as well. Funnily enough, for this instance, I added it myself 😄

Line 1178, Patchset 5: // NEW: Re-resolve the shadowrootadoptedstylesheets attribute against the
Kurt Catti-Schmidt . resolved

Maybe just "Resolve"?

Kurt Catti-Schmidt

Done

Line 1183, Patchset 5: cloned_shadow_root.GetDocument().GetExecutionContext())) {
Mason Freed . resolved

Perhaps just `factory`?

Kurt Catti-Schmidt

Done

File third_party/blink/web_tests/external/wpt/shadow-dom/declarative/tentative/shadowrootadoptedstylesheets/shadowrootadoptedstylesheets-clonenode.html
Line 193, Patchset 5: // Cross-document importNode: the source host lives in an iframe that

// declares its own import map. importNode must resolve specifiers
// against the destination document's import map (not the source's),
// because ResolveAdoptedStyleSheets uses the cloned root's document.
Kurt Catti-Schmidt . resolved

This seems kind of dangerous, given that we're re-resolving specifiers without the same import map - should we make sure the documents match (and thus import maps match) before calling `ProcessAdoptedStylesheetAttribute` on the clone? Or is this fine?

Kurt Catti-Schmidt

After more thought, this is not that different than any other import (although it is less explicit).

Kurt Catti-Schmidt

Done

Line 228, Patchset 5: // "iframe-only" is not a valid specifier in the parent doc's import

// map, so resolution silently skips it (per ResolveAdoptedStyleSheets:
// invalid specifiers are dropped). The clone's adoptedStyleSheets
// should be empty.
Mason Freed . resolved

This behavior is interesting. I trust that you've thought about it and it's correct. Just might be a bit surprising to developers?

Kurt Catti-Schmidt

Yeah, it's not great, but it's the best we can do. I thought about it some more, and it's not that different than other module imports - you need to be aware of the current document's import map no matter what.

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I90057997957ffa78333058d64136b710cda2cbff
    Gerrit-Change-Number: 7810476
    Gerrit-PatchSet: 7
    Gerrit-Owner: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Dan Clark <dan...@microsoft.com>
    Gerrit-Comment-Date: Tue, 05 May 2026 17:06:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
    satisfied_requirement
    open
    diffy

    Blink W3C Test Autoroller (Gerrit)

    unread,
    1:29 PM (1 hour ago) 1:29 PM
    to Kurt Catti-Schmidt, Mason Freed, Dan Clark, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Dan Clark

    Message from Blink W3C Test Autoroller

    Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/59668.

    When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

    WPT Export docs:
    https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dan Clark
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement 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: I90057997957ffa78333058d64136b710cda2cbff
    Gerrit-Change-Number: 7810476
    Gerrit-PatchSet: 7
    Gerrit-Owner: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Comment-Date: Tue, 05 May 2026 17:28:54 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages