Re: [WICG/webcomponents] [scoped-registries] Interaction with declarative shadow DOM (#914)

> @mfreed7 do you recall the details on why it throws for built-ins?

Well, `ElementInternals` is really geared toward custom elements, so you can't attach one for non-CEs. For example, you could otherwise try to get `ElementInternals.shadowRoot` for an `<input>` or something like that.

But importantly, I don't think the usage of `attachInternals` in the OP is really an issue. In that example, it's just being used to more easily grab the `shadowRoot` for the custom element. If you attach your own shadow root (i.e. outside a CE), you can still use scoped registries:

```html
<div id=host></div>
<script>
const shadow = host.attachShadow({mode: 'open'});
shadow.registry = new CustomElementRegistry();
</script>
```

Right?


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

Message ID: <WICG/webcomponents/issues/914/1201716410@github.com>

Received on Monday, 1 August 2022 21:02:37 UTC