summaryrefslogtreecommitdiffstats
path: root/layout/reftests/webcomponents/dynamic-insertion-point-distribution-1.html
blob: 8919a9c6a00d7c4f45b7dcce358df6a5b734e3b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html class="reftest-wait">
  <head>
  </head>
  <body>
    <div id="host"></div>
    <script>
      var host, root;

      function run() {
        host = document.getElementById("host");
        root = host.createShadowRoot();
        root.innerHTML = 'a <content></content> c';
      }

      function tweak() {
        var span = document.createElement("span");
        span.innerHTML = "b";

        // Span should be distributed to insertion point between 'a' and 'c'.
        host.appendChild(span);

        document.documentElement.removeAttribute("class");
      }

      if (document.body.createShadowRoot) {
        run();
        window.addEventListener("MozReftestInvalidate", tweak, false);
      } else {
        document.documentElement.className = "";
      }
    </script>
  </body>
</html>