reframe-shadow-child-2.html 435 B

12345678910111213141516
  1. <!doctype html>
  2. <template id="tmpl">
  3. <div style="display: block">
  4. Some text
  5. More text
  6. </div>
  7. </template>
  8. <div id="host"></div>
  9. <script>
  10. let shadowRoot = document.getElementById("host").attachShadow({mode: 'open'});
  11. let tmpl = document.getElementById("tmpl");
  12. shadowRoot.appendChild(document.importNode(tmpl.content, true));
  13. document.body.offsetTop;
  14. shadowRoot.firstElementChild.style.display = "table";
  15. </script>