Adding a custom element that has children when constructed through script (setting innerHTML) works, but having the same element in HTML throws an error saying "Failed to construct 'CustomElement': The result must not have children"
<script>
class TestElement extends HTMLElement {
constructor() {
super();
this.innerHTML = "upgraded";
}
}
customElements.define("test-element", TestElement);
</script>
WORKS:
<div id="someDiv">
<div>
<script>
someDiv.innerHTML = "<test-element></test-element>";
</script>
FAILS:
<test-element></test-element>
Comment 1 by hayato@chromium.org
, Sep 20