dynamic-insertion-point-distribution-1.html 826 B

1234567891011121314151617181920212223242526272829303132333435
  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 = 'a <content></content> c';
  13. }
  14. function tweak() {
  15. var span = document.createElement("span");
  16. span.innerHTML = "b";
  17. // Span should be distributed to insertion point between 'a' and 'c'.
  18. host.appendChild(span);
  19. document.documentElement.removeAttribute("class");
  20. }
  21. if (document.body.createShadowRoot) {
  22. run();
  23. window.addEventListener("MozReftestInvalidate", tweak, false);
  24. } else {
  25. document.documentElement.className = "";
  26. }
  27. </script>
  28. </body>
  29. </html>