shadow-dom-manual.html (760B)
1 <!DOCTYPE html> 2 <title>fieldset accessibility test: shadow DOM</title> 3 <link rel=help href=https://w3c.github.io/html-aam/#fieldset-element-accessible-name-computation> 4 <template id="my-fieldset"> 5 <fieldset id=fieldset> 6 <slot name="my-text"></slot> 7 <input> 8 </fieldset> 9 </template> 10 11 <my-fieldset> 12 <legend slot="my-text">Foo</legend> 13 </my-fieldset> 14 15 <p>Expected accessible name for id=fieldset: "" 16 17 <script> 18 customElements.define('my-fieldset', 19 class extends HTMLElement { 20 constructor() { 21 super(); 22 23 const template = document.getElementById('my-fieldset'); 24 const templateContent = template.content; 25 26 this.attachShadow({mode: 'open'}).appendChild( 27 templateContent.cloneNode(true) 28 ); 29 } 30 } 31 ); 32 </script>