Re: [WICG/webcomponents] Creating non-ugraded defined custom element : `createElement(tagname, {upgrade:false})` (Issue #1097)

denis-migdal left a comment (WICG/webcomponents#1097)

> Hmm, why would it be impossible to upgrade in the latter case?

Maybe this is an implementation issue, but on Firefox and Chromium, `customElements.upgrade()` does nothing on an element created on another document. even after `document.adoptNode(elem)` and/or `document.body.append(elem)`.

```js
class A extends HTMLElement {}

customElements.define("a-a", A);

const d = new Document();
const a = d.createElement("a-a");

document.adoptNode(a)
document.body.append(a);
customElements.upgrade(a)

console.log(a instanceof A); // gives false
```

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

Message ID: <WICG/webcomponents/issues/1097/2663919787@github.com>

Received on Monday, 17 February 2025 19:17:24 UTC