Skip to content

Conversation

@ja-y-son
Copy link

@ja-y-son ja-y-son commented Nov 19, 2025

As part of the effort to support null custom element registry elements without shadow DOM, we're updating the spec to allow the creation of element and shadowroot to use null as a valid argument and create null registry element and shadowroot.

Fixes #1413 partially. We need another PR to support element attribute for null custom element registry in addition to #1423.

  • At least two implementers are interested (and none opposed):
    • webkit
    • chromium
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for aborting and events): …
    • Node.js (only for aborting and events): …
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

@ja-y-son
Copy link
Author

@rniwa @annevk here's another PR from what we discussed.

May be a dumb question: with this change, we probably no longer want to use null as the default vaule for customElementRegistry in ShadowRootInit. In that case are we still accounting for the use case where developer passing in a ShadowRoot instance as the argument to attachShadow?

@rniwa
Copy link
Collaborator

rniwa commented Nov 19, 2025

You mean someone doing: host.attachShadow(anotherShadowRoot)? Given customElementRegistry property on ShadowRoot continue to return the custom element registry of the shadow root, I don't see how that'll be broken?

@sorvell
Copy link

sorvell commented Nov 19, 2025

This matches my understanding of the first set of changes proposed in #1413 (comment) and agreed to at TPAC. Good job!

rniwa added a commit to rniwa/web-platform-tests that referenced this pull request Nov 19, 2025
…ing null to createEleent and attachShadow per

whatwg/dom#1424

Also update the existing tests to account for the behavior differences.`
rniwa added a commit to rniwa/web-platform-tests that referenced this pull request Nov 19, 2025
…ing null to createEleent and attachShadow per

- whatwg/dom#1424
- whatwg/dom#1423

Also update the existing tests to account for the behavior differences.`
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.

Looks good modulo (my) nits.

rniwa added a commit to rniwa/web-platform-tests that referenced this pull request Nov 19, 2025
…ing null to createEleent and attachShadow per

- whatwg/dom#1424
- whatwg/dom#1423

Also update the existing tests to account for the behavior differences.`
rniwa added a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2025
…ing null to createEleent and attachShadow per (#56108)

- whatwg/dom#1424
- whatwg/dom#1423

Also update the existing tests to account for the behavior differences.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow elements with a null customElementRegistry without Shadow DOM

4 participants