blob: a004dc3b2a33f43b88d47a72a1611b2b9faf1395 [file] [log] [blame]
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<style>
body {
margin: 0px;
padding: 0px;
border: 1px solid black;
}
</style>
</head>
<body>
<svg id="background" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<path id="square" d='M50,50 z' stroke='green' stroke-width='100' stroke-linecap='square'/>
</svg>
<script><![CDATA[
if (window.testRunner) {
window.testRunner.dumpAsText();
}
var resultString = "";
var hitElementExpected1 = document.elementFromPoint(5, 50);
var hitSuccess1 = hitElementExpected1 && hitElementExpected1 == document.getElementById("square");
resultString += hitSuccess1 ? "PASSED; " : "FAIL, hit " + hitElementExpected1 + " @ 5, 50; ";
var hitElementExpected2 = document.elementFromPoint(95, 50);
var hitSuccess2 = hitElementExpected2 && hitElementExpected2 == document.getElementById("square");
resultString += hitSuccess2 ? "PASSED; " : "FAIL, hit " + hitElementExpected2 + " @ 95, 50; ";
var hitElementExpected3 = document.elementFromPoint(50, 5);
var hitSuccess3 = hitElementExpected3 && hitElementExpected3 == document.getElementById("square");
resultString += hitSuccess3 ? "PASSED; " : "FAIL, hit " + hitElementExpected3 + " @ 50, 5; ";
var hitElementExpected4 = document.elementFromPoint(50, 95);
var hitSuccess4 = hitElementExpected4 && hitElementExpected4 == document.getElementById("square");
resultString += hitSuccess4 ? "PASSED; " : "FAIL, hit " + hitElementExpected4 + " @ 50, 95; ";
hitElementExpected1 = document.elementFromPoint(5, 5);
hitSuccess1 = hitElementExpected1 && hitElementExpected1 == document.getElementById("square");
resultString += hitSuccess1 ? "PASSED; " : "FAIL, hit " + hitElementExpected1 + " @ 5, 5; ";
hitElementExpected2 = document.elementFromPoint(95, 5);
hitSuccess2 = hitElementExpected2 && hitElementExpected2 == document.getElementById("square");
resultString += hitSuccess2 ? "PASSED; " : "FAIL, hit " + hitElementExpected2 + " @ 95, 5; ";
hitElementExpected3 = document.elementFromPoint(5, 95);
hitSuccess3 = hitElementExpected3 && hitElementExpected3 == document.getElementById("square");
resultString += hitSuccess3 ? "PASSED; " : "FAIL, hit " + hitElementExpected3 + " @ 5, 95; ";
hitElementExpected4 = document.elementFromPoint(95, 95);
hitSuccess4 = hitElementExpected4 && hitElementExpected4 == document.getElementById("square");
resultString += hitSuccess4 ? "PASSED; " : "FAIL, hit " + hitElementExpected4 + " @ 95, 95; ";
document.body.innerHTML = resultString;
]]></script>
</body>
</html>