2 <script src=
"../../resources/js-test.js"></script>
4 <div id=
"testelm">The test element
<div>
6 var testElm
= document
.getElementById("testelm");
7 testElm
.addEventListener("mousemove", function(event
) {
8 if (event
.defaultPrevented
) {
9 testFailed("Mouse event already cancelled.");
12 event
.preventDefault();
13 if (!event
.defaultPrevented
) {
14 testFailed("Mouse event not cancellable.");
17 testPassed("Mouse move event cancellable.")
19 if ("eventSender" in window
) {
20 eventSender
.mouseMoveTo(testElm
.offsetLeft
+ testElm
.offsetWidth
/ 3,
21 testElm
.offsetTop
+ testElm
.offsetHeight
/ 2);
22 eventSender
.mouseMoveTo(testElm
.offsetLeft
+ testElm
.offsetWidth
/ 3 * 2,
23 testElm
.offsetTop
+ testElm
.offsetHeight
/ 2);
26 testElm
.innerHTML
= "window.eventSender not available. To test move the mouse on top of this text.";