OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 div { background: rgb(0, 0, 0); } | 3 div { background: rgb(0, 0, 0); } |
4 div:hover { background: rgb(255, 0, 0); } | 4 div:hover { background: rgb(255, 0, 0); } |
5 div:hover:active { background: rgb(255, 255, 0); } | 5 div:hover:active { background: rgb(255, 255, 0); } |
6 div:active { background: rgb(0, 255, 0); } | 6 div:active { background: rgb(0, 255, 0); } |
7 div { | 7 div { |
8 width: 100px; | 8 width: 100px; |
9 height: 100px; | 9 height: 100px; |
10 border: 2px solid rgb(0, 0, 255); | 10 border: 2px solid rgb(0, 0, 255); |
11 } | 11 } |
12 </style> | 12 </style> |
13 | 13 |
14 <body> | 14 <body> |
15 <div id="box"></div> | 15 <div id="box"></div> |
16 <div id="box2"></div> | 16 <div id="box2"></div> |
17 <pre id="description"></div> | 17 <pre id="description"></div> |
18 <pre id="console"></pre> | 18 <pre id="console"></pre> |
19 </body> | 19 </body> |
20 | 20 |
21 <script src="../js/resources/js-test-pre.js"></script> | 21 <script src="../../resources/js-test.js"></script> |
22 <script> | 22 <script> |
23 function shouldHaveBackground(element, bg) { | 23 function shouldHaveBackground(element, bg) { |
24 background = getComputedStyle(element, null).getPropertyValue("background-co
lor") | 24 background = getComputedStyle(element, null).getPropertyValue("background-co
lor") |
25 shouldBeEqualToString('background', bg) | 25 shouldBeEqualToString('background', bg) |
26 } | 26 } |
27 | 27 |
28 if (window.testRunner) { | 28 if (window.testRunner) { |
29 description("Dragging out of an element should cause it to lose :hover") | 29 description("Dragging out of an element should cause it to lose :hover") |
30 var box = document.getElementById('box') | 30 var box = document.getElementById('box') |
31 var box2 = document.getElementById('box2') | 31 var box2 = document.getElementById('box2') |
(...skipping 22 matching lines...) Expand all Loading... |
54 // Mouse still down, move outside of both boxes. | 54 // Mouse still down, move outside of both boxes. |
55 eventSender.mouseMoveTo(400, 50) | 55 eventSender.mouseMoveTo(400, 50) |
56 shouldHaveBackground(box, 'rgb(0, 255, 0)') | 56 shouldHaveBackground(box, 'rgb(0, 255, 0)') |
57 shouldHaveBackground(box2, 'rgb(0, 0, 0)') | 57 shouldHaveBackground(box2, 'rgb(0, 0, 0)') |
58 | 58 |
59 eventSender.mouseUp() | 59 eventSender.mouseUp() |
60 shouldHaveBackground(box, 'rgb(0, 0, 0)') | 60 shouldHaveBackground(box, 'rgb(0, 0, 0)') |
61 shouldHaveBackground(box2, 'rgb(0, 0, 0)') | 61 shouldHaveBackground(box2, 'rgb(0, 0, 0)') |
62 } | 62 } |
63 </script> | 63 </script> |
OLD | NEW |