- From: ja-y-son <notifications@github.com>
- Date: Mon, 29 Sep 2025 12:27:12 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/1407@github.com>
ja-y-son created an issue (whatwg/dom#1407) ### What is the issue with the DOM Standard? When calling attachShadow without specified custom element registry, is the new shadow root supposed to inherit host's custom element registry or use the global registry? From the first step in [DOM spec](https://dom.spec.whatwg.org/#dom-element-attachshadow): "Let registry be this’s custom element registry." It sounds like we are expecting the shadow root to inherit the host's custom element registry. However, from this [webkit issue](https://bugs.webkit.org/show_bug.cgi?id=299300), it sounds like this should not be the expected behavior and global registry should be used by default. Looking at the current implementation in webkit (20623.1.7.19.1), the behavior aligns with the spec and inherits the host's custom element registry instead of the global one. ``` const scopedRegistry = new CustomElementRegistry(); const scopedElement = document.createElement('div', {customElementRegistry: scopedRegistry}); const shadowRoot = element.attachShadow({mode: 'closed'}); shadowRoot.customElementRegistry === scopedRegistry // true shadowRoot.customElementRegistry === customElements // false ``` Would like to clarify the spec and the expected behavior. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1407 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1407@github.com>
Received on Monday, 29 September 2025 19:27:16 UTC