Re: [WICG/webcomponents] [scoped-registries] Consider future expansion to allow using a registry without new API (Issue #1043)

Just to clarify, I believe in general _if there is no global definition_, you won't have to use `ShadowRoot.createElement`. This is because the element will follow the rules of custom element upgrade, meaning it will upgrade when it's attached to the DOM (as long as it's `:not(:defined)` at that point). So however it's created, as long as it's initially attached to a shadowRoot with a scoped registry, it'll use that registry to upgrade... which is presumably what's expected. 

I believe this behavior follows from the [Finding a custom element definition](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Scoped-Custom-Element-Registries.md#finding-a-custom-element-definition) section of the proposal and it would also be consistent with how iframes work. 

**_But note_**, the prototype implemented in Chrome 120 + experimental web platform features does not yet implement this section of the proposal at all, so this doesn't currently work.

This is why I was focusing on a way to preserve the `:not(:defined)` state for a given, disconnected element via the "upgrade only" concept. This way it'll be a candidate for upgrade when attached to root with the "right" registry.

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

Message ID: <WICG/webcomponents/issues/1043/1883674420@github.com>

Received on Tuesday, 9 January 2024 19:45:03 UTC