10 <script src=
"../../resources/js-test.js"></script>
13 function verify(expectedColor
)
15 shouldBeEqualToString('window.getComputedStyle(document.getElementById("test")).color', expectedColor
);
20 if (!window
.eventSender
)
23 document
.onclick = function () { testFailed("Click should not have bubbled from embed!"); };
24 var pluginElement
= document
.getElementById('plugin');
25 var x
= pluginElement
.offsetLeft
+ pluginElement
.offsetWidth
/ 2;
26 var y
= pluginElement
.offsetTop
+ pluginElement
.offsetHeight
/ 2;
27 eventSender
.mouseMoveTo(x
, y
);
28 eventSender
.mouseDown();
29 eventSender
.mouseUp();
31 var testElement
= document
.getElementById('test');
32 x
= testElement
.offsetLeft
+ testElement
.offsetWidth
/ 2;
33 y
= testElement
.offsetTop
+ testElement
.offsetHeight
/ 2;
35 // Due to how mouse press / hover state is updated, the first mouse move is expected to generate incorrect hover state.
36 eventSender
.mouseMoveTo(x
, y
);
37 verify('rgb(0, 0, 255)');
39 eventSender
.mouseMoveTo(x
- 100, y
);
40 eventSender
.mouseMoveTo(x
, y
);
41 verify('rgb(0, 128, 0)');
44 <body onload=
"runTest()">
45 <p>Test that mouse state is correctly reset after clicking on a node that captures mouse events. To run this test, first click on the embed element, then mouse over
"Hover me". It should change from blue to green.
46 <embed id=
"plugin" type=
"application/x-shockwave-flash"></embed>
47 <p><a id=
"test" href=
"#">Hover me
</a>
48 <div id=
"console"></div>