<p>This tests to make sure that right clicking selects the word under the mouse.</p> | |
<div>The <span id="word">second</span> word in this sentence should be selected.</div> | |
<script> | |
if (window.layoutTestController) { | |
var word, x, y; | |
word = document.getElementById("word"); | |
x = word.offsetParent.offsetLeft + word.offsetLeft + word.offsetWidth / 2; | |
y = word.offsetParent.offsetTop + word.offsetTop + word.offsetHeight / 2; | |
eventSender.mouseMoveTo(x, y); | |
eventSender.contextClick(); | |
} | |
</script> |