dynamic-insertion-point-distribution-2.html 854 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html class="reftest-wait">
  3. <head>
  4. </head>
  5. <body>
  6. <div id="host"></div>
  7. <script>
  8. var host, root;
  9. function run() {
  10. host = document.getElementById("host");
  11. root = host.createShadowRoot();
  12. root.innerHTML = "<span>a</span>";
  13. }
  14. function tweak() {
  15. var span = document.createElement("span");
  16. span.innerHTML = "b";
  17. // Span should not be visible because it is not distributed to any
  18. // insertion points in the shadow DOM.
  19. host.appendChild(span);
  20. document.documentElement.removeAttribute("class");
  21. }
  22. if (document.body.createShadowRoot) {
  23. run();
  24. window.addEventListener("MozReftestInvalidate", tweak);
  25. } else {
  26. document.documentElement.className = "";
  27. }
  28. </script>
  29. </body>
  30. </html>