<map name="map">
<area shape="rect" coords="0,0,100,100" href="#">
</map>
<img id="target" style="width: 200; height: 200; border: solid black;" usemap="#map">
<p>
This box should turn green when hovered, except when the pointer is over the
top left quarter.
</p>
<p id="result"></p>
<script>
var target = document.getElementById("target");
target.addEventListener("mouseover", function(event) {
event.target.style.backgroundColor = "green";
document.getElementById("result").innerHTML = "Green";
}, true, false);
target.addEventListener("mouseout", function(event) {
event.target.style.backgroundColor = "";
document.getElementById("result").innerHTML = "Not green";
}, true, false);
if (window.eventSender) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
requestAnimationFrame(() => {
document.body.offsetTop;
eventSender.mouseMoveTo(150, 150);
testRunner.notifyDone();
});
}
</script>