- From: Denis Migdal <notifications@github.com>
- Date: Mon, 17 Feb 2025 11:17:20 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 17 February 2025 19:17:24 UTC
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