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 <div id="host1"></div> | 3 <div id="host1"></div> |
4 <div id="host2"></div> | 4 <div id="host2"></div> |
5 <div id="host3" class="c3"></div> | 5 <div id="host3" class="c3"></div> |
6 <div id="host4"></div> | 6 <div id="host4"></div> |
7 <script> | 7 <script> |
8 description("Check that targeted class invalidation works with the :host pseudo
class."); | 8 description("Check that targeted class invalidation works with the :host pseudo
class."); |
9 | 9 |
10 // Create shadow trees | 10 // Create shadow trees |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 host2.className = "c2"; | 43 host2.className = "c2"; |
44 if (window.internals) | 44 if (window.internals) |
45 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); | 45 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
46 shouldBe("getComputedStyle(inner, null).backgroundColor", "green"); | 46 shouldBe("getComputedStyle(inner, null).backgroundColor", "green"); |
47 | 47 |
48 document.body.offsetLeft; // force style recalc. | 48 document.body.offsetLeft; // force style recalc. |
49 | 49 |
50 host3.className = ""; | 50 host3.className = ""; |
51 if (window.internals) | 51 if (window.internals) |
52 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6"); | 52 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
53 shouldBe("getComputedStyle(host3, null).backgroundColor", "green"); | 53 shouldBe("getComputedStyle(host3, null).backgroundColor", "green"); |
54 | 54 |
55 document.body.offsetLeft; // force style recalc. | 55 document.body.offsetLeft; // force style recalc. |
56 | 56 |
57 host4.className = "c4"; | 57 host4.className = "c4"; |
58 if (window.internals) | 58 if (window.internals) |
59 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 59 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
60 shouldBe("getComputedStyle(host4, null).backgroundColor", "green"); | 60 shouldBe("getComputedStyle(host4, null).backgroundColor", "green"); |
61 | 61 |
62 </script> | 62 </script> |
OLD | NEW |