OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 #sibling { background-color: red } |
| 6 input:in-range + #sibling { background-color: green } |
| 7 </style> |
| 8 <div> |
| 9 <input id="input" type="number" min="1" max="10" value="20"> |
| 10 <span id="sibling">This text should have a green background</span> |
| 11 </div> |
| 12 <script> |
| 13 test(() => { |
| 14 assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(255, 0, 0)", |
| 15 "Sibling background initially red."); |
| 16 input.setAttribute("value", "5"); |
| 17 assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(0, 128, 0)", |
| 18 "Sibling green after input value becomes in range."); |
| 19 }, "Check that input.setAttribute('value') affects :in-range"); |
| 20 </script> |
OLD | NEW |