1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25

content / test / data / accessibility / html / custom-element-empty-slot.html [blame]

<!--
@BLINK-ALLOW:htmlTag=*
-->
<!-- An empty slot is not exposed in accessibility -->
<template id="template">
  <div><slot name="my-slot"></slot></div>
</template>

<my-element></my-element>

<script>
customElements.define(
    'my-element',
    class extends HTMLElement {
        constructor() {
            super();
            let template = document.getElementById('template');
            let templateContent = template.content;

            const shadowRoot = this.attachShadow({mode: 'open'})
                  .appendChild(templateContent.cloneNode(true));
        }
    }
);
</script>