OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <host id="host"> | 3 <host id="host"> |
4 <div> | 4 <div> |
5 <div id="green" class="b">This text should be green</div> | 5 <div id="green" class="b">This text should be green</div> |
6 </div> | 6 </div> |
7 </host> | 7 </host> |
8 <script> | 8 <script> |
9 description("No need to invalidate for selectors right of ::content as ::content
causes subtree invalidation."); | 9 description("No need to invalidate for selectors right of ::content as ::content
causes subtree invalidation."); |
10 | 10 |
11 var root = host.createShadowRoot(); | 11 var root = host.createShadowRoot(); |
12 root.innerHTML = '<style>.a ::content .b { color: green }</style><div id="outer"
><div class="b"><div class="b"><div class="b"><content/></div></div></div></div>
'; | 12 root.innerHTML = '<style>.a ::content .b { color: green }</style><div id="outer"
><div class="b"><div class="b"><div class="b"><content/></div></div></div></div>
'; |
13 | 13 |
14 shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 0, 0)"); | 14 shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 0, 0)"); |
15 | 15 |
16 host.offsetTop; // force recalc | 16 host.offsetTop; // force recalc |
17 | 17 |
18 root.querySelector("#outer").className = "a"; | 18 root.querySelector("#outer").className = "a"; |
19 if (window.internals) | 19 if (window.internals) |
20 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 20 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "2
"); |
21 | 21 |
22 shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 128, 0)"); | 22 shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 128, 0)"); |
23 </script> | 23 </script> |
OLD | NEW |