Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/testharness.js"></script> | |
| 3 <script src="../../../resources/testharnessreport.js"></script> | |
| 4 <style> | |
| 5 .t1 .sibling + *, | |
|
chrishtr
2014/07/12 00:11:59
Please add one more test like what Elliott suggest
rune
2014/08/04 20:17:14
Done.
| |
| 6 .t2 .sibling ~ *, | |
| 7 .t3 .sibling + :hover { background-color: rgb(0, 128, 0); } | |
| 8 | |
| 9 #r3 { width: 10px; height: 10px } | |
| 10 </style> | |
| 11 <div id="t1"> | |
| 12 <div class="sibling"></div> | |
| 13 <div id="r1"></div> | |
| 14 </div> | |
| 15 <div id="t2"> | |
| 16 <div class="sibling"></div> | |
| 17 <div></div> | |
| 18 <div id="r2"></div> | |
| 19 </div> | |
| 20 <div id="t3"> | |
| 21 <div class="sibling"></div> | |
| 22 <div id="r3"></div> | |
| 23 </div> | |
| 24 <script> | |
| 25 document.body.offsetTop; | |
| 26 | |
| 27 test(function() { | |
| 28 assert_true(!!window.internals, "This test only works with internals exposed present"); | |
| 29 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); | |
| 30 | |
| 31 t1.className = "t1"; | |
| 32 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc"); | |
| 33 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); | |
| 34 }, "Adjacent with universal selector"); | |
| 35 | |
| 36 test(function() { | |
| 37 assert_true(!!window.internals, "This test only works with internals exposed present"); | |
| 38 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); | |
| 39 | |
| 40 t2.className = "t2"; | |
| 41 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt ree style recalc"); | |
| 42 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); | |
| 43 }, "Indirect adjacent with universal selector"); | |
| 44 | |
| 45 test(function() { | |
| 46 assert_true(!!window.internals, "This test only works with internals exposed present"); | |
| 47 assert_true(!!window.eventSender, "This test only works with eventSender pre sent"); | |
| 48 | |
| 49 eventSender.mouseMoveTo(r3.offsetLeft + 1, r3.offsetTop + 1); | |
| 50 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac kground color should initially be transparent"); | |
| 51 | |
| 52 t3.className = "t3"; | |
| 53 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt ree style recalc"); | |
| 54 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg round color is green after class change"); | |
| 55 }, "Adjacent with universal :hover selector"); | |
| 56 </script> | |
| OLD | NEW |