OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../js/resources/js-test-pre.js"></script> |
| 3 <body> |
| 4 <div id="testelm">The test element<div> |
| 5 <script> |
| 6 var testElm = document.getElementById("testelm"); |
| 7 testElm.addEventListener("mousemove", function(event) { |
| 8 if (event.defaultPrevented) { |
| 9 testFailed("Mouse event already cancelled."); |
| 10 return; |
| 11 } |
| 12 event.preventDefault(); |
| 13 if (!event.defaultPrevented) { |
| 14 testFailed("Mouse event not cancellable."); |
| 15 return; |
| 16 } |
| 17 testPassed("Mouse move event cancellable.") |
| 18 }, false); |
| 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); |
| 24 } |
| 25 else { |
| 26 testElm.innerHTML = "window.eventSender not available. To test move the mo
use on top of this text."; |
| 27 } |
| 28 </script> |
| 29 </body> |
| 30 <script src="../js/resources/js-test-post.js"></script> |
OLD | NEW |