blob: f3118a8070eb9a822978f575e66a0fc4c852b3a4 [file] [log] [blame]
<p>This test verifies that a button that receives a mouse down event does not receive
a corresponding mouse up event when the mouse up happens outside the button.
</p>
<p>If the test passes, you'll see a PASS message below.
</p>
<p>To run this test in Safari:
<ol>
<li>Mouse down inside the button.</li>
<li>Move the mouse outside the button.</li>
<li>Mouse up.</li>
</ol>
</p>
<hr>
<input type="button" value="button!" id="button">
<pre id="log">PASS: mouse up event did not fire</pre>
<script>
function main()
{
document.getElementById('button').addEventListener("mouseup", button_mouseUp, false);
if (window.testRunner)
testRunner.dumpAsText();
if (window.eventSender) {
eventSender.mouseMoveTo(40, 20); // in button
eventSender.mouseDown();
eventSender.mouseMoveTo(40, 200); // outside button
eventSender.mouseUp();
}
}
function button_mouseUp()
{
document.getElementById('log').innerHTML = "FAIL: mouseup event fired\n";
}
main();
</script>