Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<script src="386310-script.js"></script>
<script>
customElements.define("custom-element", class extends HTMLElement {
constructor() {
super();
const template = document.getElementById("template");
const shadowRoot = this.attachShadow({mode: "open"})
.appendChild(template.content.cloneNode(true));
var span = document.createComment("generated comment to prevent bug #36");
this.insertBefore(span, this.firstChild);
}
});
</script>
</head>
<body>
<template id="template">
<span></span>
<slot></slot>
</template>
<custom-element id="test" style="display: block;">first second third [fourth]</custom-element>
</body>
</html>