shadow-fallback-dynamic-004.html (826B)
1 <!doctype html> 2 <title>CSS Scoping Module Level 1 - Dynamic fallback content</title> 3 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 4 <link rel="help" href="https://drafts.csswg.org/css-scoping/#selectors-data-model"> 5 <link rel="match" href="reference/green-box.html"/> 6 <p>Test passes if you see a single 100px by 100px green box below.</p> 7 <div id="host"> 8 <div slot="myslot" style="width: 100px; height: 100px; background: green"></div> 9 </div> 10 <script> 11 let root = host.attachShadow({ mode: "open" }); 12 root.innerHTML = ` 13 <slot name="myslot"></slot> 14 `; 15 document.body.offsetTop; 16 let newSlot = document.createElement('slot'); 17 newSlot.appendChild(document.createTextNode("FAIL")); 18 newSlot.setAttribute("name", "myslot"); 19 root.insertBefore(newSlot, root.firstChild); 20 </script>