- From: Ryosuke Niwa <notifications@github.com>
- Date: Wed, 20 Nov 2024 17:50:40 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 21 November 2024 01:50:44 UTC
Also, we have to deal with cases where elements from different scoped custom element registries coexist:
```
class OtherElement1 extends HTMLElement { };
customElements.define('other-element', OtherElement1);
const registry1 = new CustomElementRegistry;
class SomeElement extends HTMLElement { };
registry1.define('some-element', SomeElement);
class OtherElement2 extends HTMLElement { };
registry1.define('other-element', OtherElement2);
const registry2 = new CustomElementRegistry;
class OtherElement3 extends HTMLElement { };
registry2.define('other-element', OtherElement3);
const shadowRoot1 = createConnectedShadowTree(registry1);
const shadowRoot2 = createConnectedShadowTree(registry2);
const element1 = shadowRoot1.createElement('some-element');
const element2 = shadowRoot2.createElement('other-element');
element1.appendChild(element2);
element2.innerHTML = '<other-element></other-element>';
element2.querySelector('other-element'); // Is this OtherElement2 or OtherElement3?
```
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1040#issuecomment-2489899492
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/1040/2489899492@github.com>
Received on Thursday, 21 November 2024 01:50:44 UTC