reframe-shadow-child-1.html 497 B

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