| 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 .t1 .sibling + *, | 5 .t1 .sibling + *, |
| 6 .t2 .sibling ~ *, | 6 .t2 .sibling ~ *, |
| 7 .t3 .sibling + :hover, | 7 .t3 .sibling + :hover, |
| 8 .t4 + .sibling, | 8 .t4 + .sibling, |
| 9 .t5 + *, | 9 .t5 + *, |
| 10 .t6 ~ .sibling { background-color: rgb(0, 128, 0); } | 10 .t6 ~ .sibling { background-color: rgb(0, 128, 0); } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 <div class="sibling"></div> | 29 <div class="sibling"></div> |
| 30 <div id="r3"></div> | 30 <div id="r3"></div> |
| 31 </div> | 31 </div> |
| 32 </div> | 32 </div> |
| 33 <div> | 33 <div> |
| 34 <div id="t4"></div> | 34 <div id="t4"></div> |
| 35 <div id="r4" class="sibling"> | 35 <div id="r4" class="sibling"> |
| 36 <div></div> | 36 <div></div> |
| 37 <div></div> | 37 <div></div> |
| 38 </div> | 38 </div> |
| 39 <div></div> |
| 39 </div> | 40 </div> |
| 40 <div> | 41 <div> |
| 41 <div id="t5"></div> | 42 <div id="t5"></div> |
| 42 <div id="r5"> | 43 <div id="r5"> |
| 43 <div></div> | 44 <div></div> |
| 44 <div></div> | 45 <div></div> |
| 45 </div> | 46 </div> |
| 46 </div> | 47 </div> |
| 47 <div> | 48 <div> |
| 48 <div id="t6"></div> | 49 <div id="t6"></div> |
| 49 <div></div> | 50 <div></div> |
| 50 <div id="r6" class="sibling"> | 51 <div id="r6" class="sibling"> |
| 51 <div></div> | 52 <div></div> |
| 52 <div></div> | 53 <div></div> |
| 53 </div> | 54 </div> |
| 55 <div></div> |
| 54 </div> | 56 </div> |
| 55 <script> | 57 <script> |
| 56 document.body.offsetTop; | 58 document.body.offsetTop; |
| 57 | 59 |
| 58 test(function() { | 60 test(function() { |
| 59 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 61 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 60 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 62 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 61 | 63 |
| 62 t1.className = "t1"; | 64 t1.className = "t1"; |
| 63 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); | 65 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 92 t4.className = "t4"; | 94 t4.className = "t4"; |
| 93 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); | 95 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); |
| 94 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 96 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 95 }, "Class change affecting selector for sibling class"); | 97 }, "Class change affecting selector for sibling class"); |
| 96 | 98 |
| 97 test(function() { | 99 test(function() { |
| 98 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 100 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 99 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 101 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 100 | 102 |
| 101 t5.className = "t5"; | 103 t5.className = "t5"; |
| 102 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); | 104 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); |
| 103 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 105 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 104 }, "Class change affecting all sibling subtrees through a universal selector"); | 106 }, "Class change affecting all sibling subtrees through a universal selector"); |
| 105 | 107 |
| 106 test(function() { | 108 test(function() { |
| 107 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 109 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 108 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 110 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 109 | 111 |
| 110 t6.className = "t6"; | 112 t6.className = "t6"; |
| 111 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, "Subt
ree style recalc"); | 113 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); |
| 112 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 114 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 113 }, "Class change affecting all sibling subtrees through an indirect adjacent com
binator"); | 115 }, "Class change affecting all sibling subtrees through an indirect adjacent com
binator"); |
| 114 </script> | 116 </script> |
| OLD | NEW |