| 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 <style> | 4 <style> |
| 5 #p1 :not(.t1), | 5 #p1 :not(.t1), |
| 6 #p2 :not(.t2) #r2, | 6 #p2 :not(.t2) #r2, |
| 7 #p3 :not(.t3) :not(.nomatch), | 7 #p3 :not(.t3) :not(.nomatch), |
| 8 #p4 .t4 :not(.nomatch), | 8 #p4 .t4 :not(.nomatch), |
| 9 #p5 :-webkit-any(:not(.t5), #dummy) #r5, | 9 #p5 :-webkit-any(:not(.t5), #dummy) #r5, |
| 10 #p6 .t6 #r6:not(.dummy) { background-color: rgb(0, 128, 0); } | 10 #p6 .t6 #r6:not(.dummy), |
| 11 #p7 + :not(.t7) + :not(.nomatch) #r7, |
| 12 #p8 + .t8 ~ div :not(.nomatch) { background-color: rgb(0, 128, 0); } |
| 11 </style> | 13 </style> |
| 12 <div id="p1"> | 14 <div id="p1"> |
| 13 <div id="t1" class="t1"> | 15 <div id="t1" class="t1"> |
| 14 <div></div> | 16 <div></div> |
| 15 <div></div> | 17 <div></div> |
| 16 </div> | 18 </div> |
| 17 </div> | 19 </div> |
| 18 <div id="p2"> | 20 <div id="p2"> |
| 19 <div id="t2" class="t2"> | 21 <div id="t2" class="t2"> |
| 20 <div></div> | 22 <div></div> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 <div></div> | 40 <div></div> |
| 39 <div id="r5"></div> | 41 <div id="r5"></div> |
| 40 </div> | 42 </div> |
| 41 </div> | 43 </div> |
| 42 <div id="p6"> | 44 <div id="p6"> |
| 43 <div id="t6"> | 45 <div id="t6"> |
| 44 <div></div> | 46 <div></div> |
| 45 <div id="r6"></div> | 47 <div id="r6"></div> |
| 46 </div> | 48 </div> |
| 47 </div> | 49 </div> |
| 50 <div> |
| 51 <div id="p7"></div> |
| 52 <div id="t7" class="t7"></div> |
| 53 <div> |
| 54 <div></div> |
| 55 <div id="r7"></div> |
| 56 </div> |
| 57 </div> |
| 58 <div> |
| 59 <div id="p8"></div> |
| 60 <div id="t8"></div> |
| 61 <div> |
| 62 <div></div> |
| 63 <div id="r8"></div> |
| 64 </div> |
| 65 <div></div> |
| 66 </div> |
| 67 |
| 48 <script> | 68 <script> |
| 49 document.body.offsetTop; | 69 document.body.offsetTop; |
| 50 | 70 |
| 51 test(function() { | 71 test(function() { |
| 52 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 72 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 53 assert_equals(getComputedStyle(t1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 73 assert_equals(getComputedStyle(t1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 54 | 74 |
| 55 t1.className = ""; | 75 t1.className = ""; |
| 56 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Sing
le element style recalc"); | 76 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Sing
le element style recalc"); |
| 57 assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 77 assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 }, "Id descendant of negated class in :-webkit-any"); | 114 }, "Id descendant of negated class in :-webkit-any"); |
| 95 | 115 |
| 96 test(function() { | 116 test(function() { |
| 97 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 117 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 98 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 118 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 99 | 119 |
| 100 t6.className = "t6"; | 120 t6.className = "t6"; |
| 101 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Reca
lc changed element and #r6"); | 121 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Reca
lc changed element and #r6"); |
| 102 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 122 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 103 }, "Negated class with id descendant of class"); | 123 }, "Negated class with id descendant of class"); |
| 124 |
| 125 test(function() { |
| 126 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 127 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 128 |
| 129 t7.className = ""; |
| 130 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Reca
lc changed element and #r7"); |
| 131 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 132 }, "Id descendant of negated sibling class"); |
| 133 |
| 134 test(function() { |
| 135 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 136 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 137 |
| 138 t8.className = "t8"; |
| 139 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); |
| 140 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 141 }, "Negated class descendant of sibling class"); |
| 142 |
| 104 </script> | 143 </script> |
| OLD | NEW |