Re: [WICG/webcomponents] [scoped-registries] Finding a definition for disconnected elements (Issue #1040)

> @annevk and I discussed an alternative approach, which is to permanently associate each element with the registry from which it was created.

What happens in this case and would this be a breaking change?

```js
customElements.define('x-foo', class XFoo extends HTMLElement {});
customElements.define('x-bar', class XBar extends HTMLElement {});
const template = document.createElement('template');
template.innerHTML = `<x-foo></x-foo>`;
const clone = template.content.cloneNode(true);
// it has the registry from the template content's document which is empty?
const xFoo = clone.firstChild; 
document.body.append(clone);

xFoo instanceof XFoo // is this true?

xFoo.innerHTML = `<x-bar></x-bar>`;
xBar = xFoo.firstChild;

xBar instanceof XBar // is this true?
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1040#issuecomment-2491147500
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/1040/2491147500@github.com>

Received on Thursday, 21 November 2024 13:26:41 UTC