- From: mantou <notifications@github.com>
- Date: Tue, 10 Nov 2020 15:01:56 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 10 November 2020 23:02:08 UTC
example:
```js
class AppElement extends HTMLElement {
constructor(appTitle) {
super();
Object.defineProperty(this, "appTitle", {
set(v) {
if (v) {
this.setAttribute("app-title", v);
} else {
console.log(
"Attribute has been cloned:",
this.hasAttribute("app-title")
);
this.removeAttribute("app-title");
}
}
});
this.appTitle = appTitle;
}
}
customElements.define("app-root", AppElement);
const app = new AppElement("title");
console.log(app.outerHTML === app.cloneNode().outerHTML);
```
[CodeSandbox](https://codesandbox.io/s/muddy-tdd-r8zno?file=/src/index.js)
I read [this](https://dom.spec.whatwg.org/#concept-node-clone-ext), it should be `true` if you create the element first and then copy the attribute
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/922
Received on Tuesday, 10 November 2020 23:02:08 UTC