3 div { background: rgb(
0,
0,
0); }
4 div:hover { background: rgb(
255,
0,
0); }
5 div:hover:active { background: rgb(
255,
255,
0); }
6 div:active { background: rgb(
0,
255,
0); }
10 border:
2px solid rgb(
0,
0,
255);
17 <pre id=
"description"></div>
18 <pre id=
"console"></pre>
21 <script src=
"../../resources/js-test.js"></script>
23 function shouldHaveBackground(element
, bg
) {
24 background
= getComputedStyle(element
, null).getPropertyValue("background-color")
25 shouldBeEqualToString('background', bg
)
28 if (window
.testRunner
) {
29 description("Dragging out of an element should cause it to lose :hover")
30 var box
= document
.getElementById('box')
31 var box2
= document
.getElementById('box2')
32 testRunner
.dumpAsText();
34 eventSender
.dragMode
= false;
35 // This mouse click seems to be required for WebKit's event handling to
36 // pick up the :hover class. See https://bugs.webkit.org/show_bug.cgi?id=74264
37 eventSender
.mouseDown()
40 // Move into the first box.
41 eventSender
.mouseMoveTo(50, 50)
42 shouldHaveBackground(box
, 'rgb(255, 0, 0)')
43 shouldHaveBackground(box2
, 'rgb(0, 0, 0)')
45 eventSender
.mouseDown()
46 shouldHaveBackground(box
, 'rgb(255, 255, 0)')
47 shouldHaveBackground(box2
, 'rgb(0, 0, 0)')
49 // With the mouse still down, move into the second box.
50 eventSender
.mouseMoveTo(50, 150)
51 shouldHaveBackground(box
, 'rgb(0, 255, 0)')
52 shouldHaveBackground(box2
, 'rgb(0, 0, 0)')
54 // Mouse still down, move outside of both boxes.
55 eventSender
.mouseMoveTo(400, 50)
56 shouldHaveBackground(box
, 'rgb(0, 255, 0)')
57 shouldHaveBackground(box2
, 'rgb(0, 0, 0)')
60 shouldHaveBackground(box
, 'rgb(0, 0, 0)')
61 shouldHaveBackground(box2
, 'rgb(0, 0, 0)')