2 <script src=
"../../../resources/js-test.js"></script>
4 #outerHost { color: red }
8 <span id=
"outerSpan"></span>
20 description("Insert a style element into a shadow tree affecting a distributed node.");
22 var outerRoot
= outerHost
.createShadowRoot();
23 outerRoot
.innerHTML
= "<div id='host1'><content/></div>";
25 var host1
= outerRoot
.querySelector("#host1");
26 var root1
= host1
.createShadowRoot();
27 root1
.innerHTML
= "<div id='host2'><content/></div>";
29 var host2
= root1
.querySelector("#host2");
30 var root2
= host2
.createShadowRoot();
31 root2
.innerHTML
= "<content/>";
33 shouldBeEqualToString("getComputedStyle(outerSpan).color", "rgb(255, 0, 0)");
35 document
.body
.offsetTop
;
36 var sheet
= document
.createElement("style");
37 sheet
.appendChild(document
.createTextNode("::content #outerSpan { color: green }"));
38 root2
.appendChild(sheet
);
41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5");
43 shouldBeEqualToString("getComputedStyle(outerSpan).color", "rgb(0, 128, 0)");