Skip to content

Conversation

@ja-y-son
Copy link
Contributor

@ja-y-son ja-y-son commented Dec 2, 2025

Add test cases that covers the scenarios in whatwg/dom#1437

@ja-y-son
Copy link
Contributor Author

ja-y-son commented Dec 4, 2025

@annevk PTAL, thanks!

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have some tests where you just call adoptNode(). And some tests with attachShadow() instead of declarative shadow roots.

And some tests where we initialize() various parent nodes in this null/global shadow tree with a scoped registry prior to adoption.

@ja-y-son
Copy link
Contributor Author

Added more test cases to hopefully cover most of the adoption cases that we're interested in this spec change. I haven't implemented this part of spec change in chromium so I tried my best to verify that each test case is asserting the correct expectation, but will appreciate a lot for another review of them.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good. I'd like to try this in WebKit, but the patch needs rebasing it seems.

cc @rniwa


function runTest(operation, operationName) {
// Null registry child tests
test((test) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional nit (applies quite a few times):

Suggested change
test((test) => {
test(test => {

@ja-y-son
Copy link
Contributor Author

ja-y-son commented Jan 4, 2026

@annevk Updated the nit. Let me know if you've tried on Safari and if you think we should make any other changes on the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants