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