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); |
(...skipping 13 matching lines...) Expand all Loading... |
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') |
32 testRunner.dumpAsText(); | 32 testRunner.dumpAsText(); |
33 | 33 |
34 // Mouse events only work after an initial layout | |
35 document.body.offsetLeft; | |
36 | |
37 eventSender.dragMode = false; | 34 eventSender.dragMode = false; |
38 // This mouse click seems to be required for WebKit's event handling to | 35 // This mouse click seems to be required for WebKit's event handling to |
39 // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=742
64 | 36 // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=742
64 |
40 eventSender.mouseDown() | 37 eventSender.mouseDown() |
41 eventSender.mouseUp() | 38 eventSender.mouseUp() |
42 | 39 |
43 // Move into the first box. | 40 // Move into the first box. |
44 eventSender.mouseMoveTo(50, 50) | 41 eventSender.mouseMoveTo(50, 50) |
45 shouldHaveBackground(box, 'rgb(255, 0, 0)') | 42 shouldHaveBackground(box, 'rgb(255, 0, 0)') |
46 shouldHaveBackground(box2, 'rgb(0, 0, 0)') | 43 shouldHaveBackground(box2, 'rgb(0, 0, 0)') |
(...skipping 10 matching lines...) Expand all Loading... |
57 // Mouse still down, move outside of both boxes. | 54 // Mouse still down, move outside of both boxes. |
58 eventSender.mouseMoveTo(400, 50) | 55 eventSender.mouseMoveTo(400, 50) |
59 shouldHaveBackground(box, 'rgb(0, 255, 0)') | 56 shouldHaveBackground(box, 'rgb(0, 255, 0)') |
60 shouldHaveBackground(box2, 'rgb(0, 0, 0)') | 57 shouldHaveBackground(box2, 'rgb(0, 0, 0)') |
61 | 58 |
62 eventSender.mouseUp() | 59 eventSender.mouseUp() |
63 shouldHaveBackground(box, 'rgb(0, 0, 0)') | 60 shouldHaveBackground(box, 'rgb(0, 0, 0)') |
64 shouldHaveBackground(box2, 'rgb(0, 0, 0)') | 61 shouldHaveBackground(box2, 'rgb(0, 0, 0)') |
65 } | 62 } |
66 </script> | 63 </script> |
OLD | NEW |