slot-fallback-content-001.html (684B)
1 <!DOCTYPE html> 2 <meta charset="utf-8" > 3 <meta name="author" title="Di Zhang" href="mailto:dizhangg@chromium.org"> 4 <meta name="assert" content="Child nodes in host are default assigned to unnamed slot, when dynamically created."> 5 <title>Shadow DOM: Slots and fallback contents</title> 6 <link rel="match" href="slot-fallback-content-001-ref.html"> 7 8 <p>Test passes if there are two lines of text "A", "B" below.</p> 9 10 <div id="host"> 11 <slot id="slot1">FAIL</slot> 12 <div id="A">A</div> 13 <div id="A">B</div> 14 </div> 15 16 <script> 17 // Both divs A and B overwrite fallback contents of default slot 18 const shadowRoot = host.attachShadow({ mode: "open" }); 19 shadowRoot.appendChild(slot1); 20 21 </script>