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(span, div) { color: green; } |
| 6 .t2 :-webkit-any(#x1, #x2) { color: green; } |
| 7 </style> |
| 8 <p>Both elements below should be green.</p> |
| 9 <div id="t1"> |
| 10 <div>Green</div> |
| 11 <span>Green</span> |
| 12 </div> |
| 13 <div id="t2"> |
| 14 <div id="x1">Green</div> |
| 15 <div id="x2">Green</div> |
| 16 </div> |
| 17 <script> |
| 18 document.body.offsetTop; |
| 19 |
| 20 test(() => { |
| 21 assert_equals(getComputedStyle(t1.querySelector("div")).color, "rgb(0, 0
, 0)"); |
| 22 assert_equals(getComputedStyle(t1.querySelector("span")).color, "rgb(0,
0, 0)"); |
| 23 assert_equals(getComputedStyle(x1).color, "rgb(0, 0, 0)"); |
| 24 assert_equals(getComputedStyle(x2).color, "rgb(0, 0, 0)"); |
| 25 }, "Preconditions."); |
| 26 |
| 27 test(() => { |
| 28 t1.className = "t1"; |
| 29 assert_equals(getComputedStyle(t1.querySelector("div")).color, "rgb(0, 1
28, 0)"); |
| 30 assert_equals(getComputedStyle(t1.querySelector("span")).color, "rgb(0,
128, 0)"); |
| 31 }, "Invalidate two type selectors."); |
| 32 |
| 33 test(() => { |
| 34 t2.className = "t2"; |
| 35 assert_equals(getComputedStyle(x1).color, "rgb(0, 128, 0)"); |
| 36 assert_equals(getComputedStyle(x2).color, "rgb(0, 128, 0)"); |
| 37 }, "Invalidate two id selectors."); |
| 38 </script> |
OLD | NEW |