[whatwg/dom] Set registry on null registry element on adopt instead of on insert (PR #1423)

<!--
Thank you for contributing to the DOM Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.

When you submit this PR, and each time you edit this comment (including checking a checkbox through the UI!), PR Preview will run and update it. As such make any edits in one go and only after PR Preview has run.

If you think your PR is ready to land, please double-check that the build is passing and the checklist is complete before pinging.
-->

In order to support scenarios for elements with a null custom element registry without shadow DOM, we decided to modify the behavior when it comes to setting registry on null registry element. By setting the registry on adopt instead of on insert allows us to have null registry element in light DOM while being backwards-compatible.

Fixes #1413 partially. There are two more spec changes expected to add element attribute and allow null registry option during element creation and shadow attachment as mentioned in https://github.com/whatwg/dom/issues/1413#issuecomment-3530198733



- [x] At least two implementers are interested (and none opposed):
   * WebKit
   * Chromium
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * … <!-- If these tests are tentative, link a PR to make them non-tentative. -->
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: …
   * Gecko: …
   * WebKit: …
   * Deno (only for aborting and events): …
   * Node.js (only for aborting and events): …
- [x] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: N/A
- [x] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/dom/1423.html" title="Last updated on Nov 17, 2025, 11:15 PM UTC (3db9d70)">Preview</a> | <a href="https://whatpr.org/dom/1423/918ebc0...3db9d70.html" title="Last updated on Nov 17, 2025, 11:15 PM UTC (3db9d70)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/1423

-- Commit Summary --

  * Remove registry restoration on insert but do it in adopt

-- File Changes --

    M dom.bs (33)

-- Patch Links --

https://github.com/whatwg/dom/pull/1423.patch
https://github.com/whatwg/dom/pull/1423.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/1423
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/pull/1423@github.com>

Received on Monday, 17 November 2025 23:15:46 UTC