| 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 <fieldset> |
| 66 <div></div> |
| 67 </fieldset> |
| 68 </div> |
| 69 |
| 48 <script> | 70 <script> |
| 49 document.body.offsetTop; | 71 document.body.offsetTop; |
| 50 | 72 |
| 51 test(function() { | 73 test(function() { |
| 52 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 74 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"); | 75 assert_equals(getComputedStyle(t1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 54 | 76 |
| 55 t1.className = ""; | 77 t1.className = ""; |
| 56 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Sing
le element style recalc"); | 78 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"); | 79 assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 58 }, "Negated class without combinators"); | 80 }, "Negated class without combinators"); |
| 59 | 81 |
| 60 test(function() { | 82 test(function() { |
| 61 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 83 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 62 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 84 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 63 | 85 |
| 64 t2.className = ""; | 86 t2.className = ""; |
| 65 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Reca
lc changed element and #r2"); | 87 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Reca
lc changed element and #r2"); |
| 66 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 88 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 67 }, "Id descendant of negated class"); | 89 }, "Id descendant of negated class"); |
| 68 | 90 |
| 69 test(function() { | 91 test(function() { |
| 70 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 92 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 71 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 93 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 72 | 94 |
| 73 t3.className = ""; | 95 t3.className = ""; |
| 74 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); | 96 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); |
| 75 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 97 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 76 }, "Negated class descendant of negated class"); | 98 }, "Negated class descendant of negated class"); |
| 77 | 99 |
| 78 test(function() { | 100 test(function() { |
| 79 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 101 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 80 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 102 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 81 | 103 |
| 82 t4.className = "t4"; | 104 t4.className = "t4"; |
| 83 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); | 105 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); |
| 84 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 106 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 85 }, "Negated class descendant of class"); | 107 }, "Negated class descendant of class"); |
| 86 | 108 |
| 87 test(function() { | 109 test(function() { |
| 88 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 110 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 89 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 111 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 90 | 112 |
| 91 t5.className = ""; | 113 t5.className = ""; |
| 92 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Reca
lc changed element and #r5"); | 114 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Reca
lc changed element and #r5"); |
| 93 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 115 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 94 }, "Id descendant of negated class in :-webkit-any"); | 116 }, "Id descendant of negated class in :-webkit-any"); |
| 95 | 117 |
| 96 test(function() { | 118 test(function() { |
| 97 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 119 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"); | 120 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 99 | 121 |
| 100 t6.className = "t6"; | 122 t6.className = "t6"; |
| 101 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Reca
lc changed element and #r6"); | 123 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Reca
lc changed element and #r6"); |
| 102 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 124 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"); | 125 }, "Negated class with id descendant of class"); |
| 126 |
| 127 test(function() { |
| 128 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 129 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 130 |
| 131 t7.className = ""; |
| 132 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Reca
lc changed element and #r7"); |
| 133 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 134 }, "Id descendant of negated sibling class"); |
| 135 |
| 136 test(function() { |
| 137 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 138 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 139 |
| 140 t8.className = "t8"; |
| 141 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); |
| 142 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 143 }, "Negated class descendant of sibling class"); |
| 144 |
| 104 </script> | 145 </script> |
| OLD | NEW |