<html xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
border: 1px solid black; | |
} | |
#square { | |
fill: blue; | |
} | |
#square:hover { | |
fill: green; | |
} | |
</style> | |
</head> | |
<body> | |
<table><tr><td> | |
<svg width='100px' height='100px' style='padding: 50px' xmlns='http://www.w3.org/2000/svg'> | |
<svg> | |
<rect id='square' width='100' height='100' onclick='alert("You clicked the square! It worked!")'/> | |
</svg> | |
</svg> | |
</td></tr></table> | |
<script><![CDATA[ | |
if (window.testRunner) { | |
testRunner.dumpAsText(); | |
} | |
var hitElement = document.elementFromPoint(75, 75); | |
var hitSuccess = hitElement && hitElement == document.getElementById("square"); | |
document.body.innerHTML = hitSuccess ? "PASSED" : "FAIL, hit " + hitElement + " @ 50, 50"; | |
]]></script> | |
</body> | |
</html> |