[scoped-registry] Null registry element should get registry on adopt instead of insert [chromium/src : main]

0 views
Skip to first unread message

Jayson Chen (Gerrit)

unread,
Jan 9, 2026, 5:07:04 PM (2 days ago) Jan 9
to AyeAye, Mason Freed, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Jayson Chen, Joey Arhar and Mason Freed

Message from Jayson Chen

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Jayson Chen
  • Joey Arhar
  • 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: I63b8a7bcef98ead66bd1375c9b1df69d9b9bd597
Gerrit-Change-Number: 7078864
Gerrit-PatchSet: 8
Gerrit-Owner: Jayson Chen <jayso...@microsoft.com>
Gerrit-Reviewer: Jayson Chen <jayso...@microsoft.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Jayson Chen <jayso...@microsoft.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jan 2026 22:06:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jayson Chen (Gerrit)

unread,
Jan 9, 2026, 5:13:07 PM (2 days ago) Jan 9
to AyeAye, Mason Freed, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Joey Arhar and Mason Freed

Jayson Chen added 6 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Jayson Chen . resolved

Updated the CL to leverage RemovedFrom and InsertedInto so the implementation is cleaner.

Commit Message
Line 9, Patchset 1:This fixes the case where the custom element registry gets changed during
Mason Freed . resolved

uber-nit: please line wrap commit descriptions at 72 chars. This is 73. 😊

Jayson Chen

Done

File third_party/blink/renderer/core/dom/node.cc
Line 975, Patchset 1: if (RuntimeEnabledFeatures::ScopedCustomElementRegistryEnabled()) {
for (Node& descendant_node : NodeTraversal::InclusiveDescendantsOf(*new_child)) {
Mason Freed . resolved

It feels really weird to be putting this only here, in Node::appendChild. Shouldn't it be down in something like ContainerNode::AppendChild or ContainerNode ::InsertNodeVector or somewhere shared with the rest? I.e. shouldn't the same thing happen for insertBefore(), or replaceChildren()?

Jayson Chen

Not applicable as the impl changed.

Line 978, Patchset 1: // Note that SustainCustomElementRegistry does not sustain null registry.
// In the event of needing to sustain null registry, we need to add
// additional logic to handle that case.
Mason Freed . resolved

Is this a problem?

Jayson Chen

Not applicable as the impl changed.

Line 1108, Patchset 1: // registry before the move as an element's registry can only be set once.
if (RuntimeEnabledFeatures::ScopedCustomElementRegistryEnabled()) {
for (Node* target_node : nodes) {
if (auto* target_element = DynamicTo<Element>(target_node)) {
target_element->SustainCustomElementRegistry();
}
}
}
Mason Freed . resolved

ditto - this is a duplicate, likely because it belongs lower, right?

Jayson Chen

Not applicable as the impl changed.

File third_party/blink/web_tests/virtual/scoped-custom-element-registry/external/wpt/custom-elements/registries/element-mutation-expected.txt
File-level comment, Patchset 1:
Mason Freed . unresolved

Ideally this test tests the various ways nodes can be moved around the tree also. E.g.

appendChild
insertBefore
append
prepend
before
after
replaceWith
moveBefore

Ordinarily I wouldn't suggest that everywhere, but I believe it might catch the bug above?

Jayson Chen

Now that we're not implementing in a way that's specific to append but mutation in general, should we still test all the mutation methods?

Open in Gerrit

Related details

Attention is currently required from:
  • Joey Arhar
  • 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: I63b8a7bcef98ead66bd1375c9b1df69d9b9bd597
Gerrit-Change-Number: 7078864
Gerrit-PatchSet: 9
Gerrit-Owner: Jayson Chen <jayso...@microsoft.com>
Gerrit-Reviewer: Jayson Chen <jayso...@microsoft.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jan 2026 22:12:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages