| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div id="t1"> | 4 <div id="t1"> |
| 5 <div id="host1"></div> | 5 <div id="host1"></div> |
| 6 </div> | 6 </div> |
| 7 <div id="t2"> | 7 <div id="t2"> |
| 8 <div id="host2"></div> | 8 <div id="host2"></div> |
| 9 </div> | 9 </div> |
| 10 <div id="t3" class="t3"> | 10 <div id="t3" class="t3"> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (window.internals) | 31 if (window.internals) |
| 32 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); | 32 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); |
| 33 assert_equals(getComputedStyle(host1, "").backgroundColor, green, "Backgroun
d color after class change."); | 33 assert_equals(getComputedStyle(host1, "").backgroundColor, green, "Backgroun
d color after class change."); |
| 34 }, "Matching :host-context with class."); | 34 }, "Matching :host-context with class."); |
| 35 | 35 |
| 36 test(function(){ | 36 test(function(){ |
| 37 var inner = host2.shadowRoot.getElementById("inner"); | 37 var inner = host2.shadowRoot.getElementById("inner"); |
| 38 assert_equals(getComputedStyle(inner, "").backgroundColor, transparent, "Bac
kground color before class change."); | 38 assert_equals(getComputedStyle(inner, "").backgroundColor, transparent, "Bac
kground color before class change."); |
| 39 t2.className = "t2"; | 39 t2.className = "t2"; |
| 40 if (window.internals) | 40 if (window.internals) |
| 41 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); | 41 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "
Element recalc count on class change."); |
| 42 assert_equals(getComputedStyle(inner, "").backgroundColor, green, "Backgroun
d color after class change."); | 42 assert_equals(getComputedStyle(inner, "").backgroundColor, green, "Backgroun
d color after class change."); |
| 43 }, "Matching id descendant of :host-context with class."); | 43 }, "Matching id descendant of :host-context with class."); |
| 44 | 44 |
| 45 test(function(){ | 45 test(function(){ |
| 46 assert_equals(getComputedStyle(host3, "").backgroundColor, transparent, "Bac
kground color before class change."); | 46 assert_equals(getComputedStyle(host3, "").backgroundColor, transparent, "Bac
kground color before class change."); |
| 47 t3.className = ""; | 47 t3.className = ""; |
| 48 if (window.internals) | 48 if (window.internals) |
| 49 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); | 49 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); |
| 50 assert_equals(getComputedStyle(host3, "").backgroundColor, green, "Backgroun
d color after class change."); | 50 assert_equals(getComputedStyle(host3, "").backgroundColor, green, "Backgroun
d color after class change."); |
| 51 }, "Matching :host-context with id and negated class."); | 51 }, "Matching :host-context with id and negated class."); |
| 52 | 52 |
| 53 test(function(){ | 53 test(function(){ |
| 54 assert_equals(getComputedStyle(host4, "").backgroundColor, transparent, "Bac
kground color before class change."); | 54 assert_equals(getComputedStyle(host4, "").backgroundColor, transparent, "Bac
kground color before class change."); |
| 55 t4.className = "t4"; | 55 t4.className = "t4"; |
| 56 if (window.internals) | 56 if (window.internals) |
| 57 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); | 57 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 8, "
Element recalc count on class change."); |
| 58 assert_equals(getComputedStyle(host4, "").backgroundColor, green, "Backgroun
d color after class change."); | 58 assert_equals(getComputedStyle(host4, "").backgroundColor, green, "Backgroun
d color after class change."); |
| 59 }, "Matching :host-context with selector list of classes."); | 59 }, "Matching :host-context with selector list of classes."); |
| 60 </script> | 60 </script> |
| OLD | NEW |