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
   26
   27
   28
   29

content / test / data / accessibility / accdescription / description-ignores-slot.html [blame]

<!--
@BLINK-ALLOW:description=*
@BLINK-ALLOW:descriptionFrom=*
-->
<!-- AccName calculation should ignore slot element -->
<template id="template">
  <slot id="slot" aria-label="label on slot" name="my-slot">default content</slot>
  <button aria-describedby="slot" id="test">foobar</button>
</template>

<my-element>
  <b slot="my-slot">description</b>
</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>