<style> | |
div { border: 2px solid blue; display:inline-block; margin-left:100px; width:200px; } | |
button { margin-left:-75px; width:50px; height:50px; } | |
</style> | |
<div><button>X</button></div> | |
<pre id=log></pre> | |
<script> | |
if (window.testRunner) | |
testRunner.dumpAsText(); | |
const hitTestElement = document.elementFromPoint(50, 50); | |
log.innerText = hitTestElement == document.querySelector('button') ? "PASS" : "FAIL"; | |
</script> |