layout-slot-no-longer-fallback.html (541B)
1 <!DOCTYPE html> 2 <title>Layout using slot elements</title> 3 <link rel="author" title="Hayato Ito" href="mailto:hayato@google.com"/> 4 <link rel="help" href="https://dom.spec.whatwg.org/#shadow-tree-slots"> 5 <link rel="match" href="reference/empty.html"/> 6 <div id="host"></div> 7 <script> 8 const host = document.querySelector('#host'); 9 const sr = host.attachShadow({ mode: 'open' }); 10 11 sr.innerHTML = '<slot><div id="fallback">Should not be displayed</div></slot>' 12 13 document.body.offsetLeft; 14 host.appendChild(document.createElement('div')); 15 </script>