| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 #testBox { |
| 4 background: blue; |
| 5 top: 100px; |
| 6 left: 100px; |
| 7 width: 100px; |
| 8 height: 100px; |
| 9 position: absolute; |
| 10 } |
| 11 </style> |
| 12 <div id="testBox"> |
| 13 </div> |
| 14 <p id="description"> |
| 15 </p> |
| 16 <script src="../../resources/js-test.js"></script> |
| 17 <script> |
| 18 window.jsTestIsAsync = true; |
| 19 |
| 20 description('Test that a mouse leave event is triggered when the OS tells us
the mouse has left without changing position.'); |
| 21 var hasMouseLeave = false; |
| 22 var hasMouseOut = false; |
| 23 var box = document.getElementById('testBox'); |
| 24 var lastMouseX = 0; |
| 25 var lastMouseY = 0; |
| 26 box.addEventListener('mouseleave', function (e) { |
| 27 hasMouseLeave = true; |
| 28 lastMouseX = e.clientX; |
| 29 lastMouseY = e.clientY; |
| 30 }); |
| 31 box.addEventListener('mouseout', function () { |
| 32 hasMouseOut = true; |
| 33 }); |
| 34 if (window.testRunner) { |
| 35 eventSender.mouseMoveTo(1, 1); |
| 36 eventSender.mouseMoveTo(box.offsetLeft + 10, box.offsetTop + 10); |
| 37 eventSender.mouseLeave(); |
| 38 shouldBeTrue('hasMouseLeave'); |
| 39 shouldBeTrue('hasMouseOut'); |
| 40 shouldBe('box.offsetLeft + 10', 'lastMouseX'); |
| 41 shouldBe('box.offsetTop + 10', 'lastMouseY'); |
| 42 finishJSTest(); |
| 43 } |
| 44 </script> |
| OLD | NEW |