basic-slot-4.html (503B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <script> 5 function tweak() { 6 var slot = document.createElement("slot"); 7 // The border shouldn't be visible, due to display: contents. 8 slot.style.border = "1px solid red"; 9 slot.style.color = "green"; 10 11 var shadowRoot = 12 document.getElementById('outer').attachShadow({mode: 'open'}); 13 shadowRoot.appendChild(slot); 14 } 15 </script> 16 </head> 17 <body onload="tweak()"> 18 <div id="outer">This text should be green</div> 19 </body> 20 </html>