OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 .t1 :-webkit-any(*, .dummy), |
| 6 .t2 :-webkit-any(:-webkit-any(.dummy, *), .dummy), |
| 7 .t3 :-webkit-any(:focus, dummy) { background-color: rgb(0, 128, 0); } |
| 8 |
| 9 #r3 { width: 10px; height: 10px } |
| 10 </style> |
| 11 <div id="t1"> |
| 12 <div id="r1"></div> |
| 13 </div> |
| 14 <div id="t2"> |
| 15 <div id="r2"></div> |
| 16 </div> |
| 17 <div id="t3"> |
| 18 <div id="r3" tabIndex="1"></div> |
| 19 </div> |
| 20 <script> |
| 21 document.body.offsetTop; |
| 22 |
| 23 test(function() { |
| 24 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 25 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 26 |
| 27 t1.className = "t1"; |
| 28 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt
ree style recalc"); |
| 29 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 30 }, ":-webkit-any() with universal selector"); |
| 31 |
| 32 test(function() { |
| 33 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 34 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 35 |
| 36 t2.className = "t2"; |
| 37 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt
ree style recalc"); |
| 38 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 39 }, "Nested :-webkit-any() with universal selector"); |
| 40 |
| 41 test(function() { |
| 42 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
| 43 |
| 44 r3.focus(); |
| 45 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
| 46 |
| 47 t3.className = "t3"; |
| 48 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt
ree style recalc"); |
| 49 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
| 50 }, ":-webkit-any() with universal :focus selector"); |
| 51 </script> |
OLD | NEW |