OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 label { |
| 6 background-color: black; |
| 7 } |
| 8 input:active + label { |
| 9 background-color: red; |
| 10 } |
| 11 #nodisplay { |
| 12 display: none; |
| 13 } |
| 14 </style> |
| 15 <input id="nodisplay" type="checkbox"/> |
| 16 <label id="label1" for="nodisplay">The target input has its display set to none.
</label> |
| 17 <script> |
| 18 test(function() { |
| 19 assert_true(window.eventSender !== null); |
| 20 }, "window.eventSender is required for the test to run"); |
| 21 |
| 22 test(function() { |
| 23 var l1 = document.getElementById("label1"); |
| 24 var x = l1.offsetLeft + l1.offsetWidth/2; |
| 25 var y = l1.offsetTop + l1.offsetHeight/2; |
| 26 eventSender.mouseMoveTo(x, y); |
| 27 eventSender.mouseDown(); |
| 28 assert_equals(getComputedStyle(l1).backgroundColor, 'rgb(255, 0, 0)'); |
| 29 eventSender.mouseUp(); |
| 30 assert_equals(getComputedStyle(l1).backgroundColor, 'rgb(0, 0, 0)'); |
| 31 }, "This test performs a check for active pseudo class to be applied for element
when its display is set to none."); |
| 32 </script> |
OLD | NEW |