1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
content / test / data / accessibility / html / shadow-dom-first-child.html [blame]
<!doctype html>
<my-custom-element style="display:none"></my-custom-element>
<script>
class MyCustomElement extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
setTimeout(() => {
var div = document.createElement('div');
div.innerText = "test"
this.shadowRoot.appendChild(div);
div.setAttribute("aria-label", "aria label");
}, 0);
}
}
customElements.define('my-custom-element', MyCustomElement);
</script>