blob: c04726d20e1b343d22a09a5499b5a6f836b9da51 [file] [log] [blame]
<svg xmlns="http://www.w3.org/2000/svg">
<rect width="100" height="100" fill="red" onclick="window.alert('FAIL: click not sent to FO content.');"/>
<foreignObject width="100" height="100">
<body xmlns="http://www.w3.org/1999/xhtml" style="margin: 0; padding: 0;">
<!-- Clicking on the green div (background) should be dispatched to the div element and not to the red SVG rect underneath. -->
<div id="target" style="width: 100px; height: 100px; background-color:green;" onclick="window.alert('PASS: click sent to FO content.');"></div>
</body>
</foreignObject>
<script><![CDATA[
if (window.testRunner) {
testRunner.dumpAsText();
var hitElement = document.elementFromPoint(50, 50);
var hitSuccess = hitElement && hitElement == document.getElementById("target");
document.getElementById('target').innerHTML = hitSuccess ? 'PASS' : 'FAIL';
} else {
document.getElementById('target').innerHTML = 'Click me.';
}
]]></script>
</svg>