1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:18:13 +00:00

Base: Add a browser test page that dumps out all mouse events

This commit is contained in:
Andreas Kling 2022-02-07 13:26:46 +01:00
parent 438c5bce6c
commit 6c31f6c073
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,22 @@
<style>
#rect {
width: 300px;
height: 300px;
border: 5px solid black;
}
</style>
<div id=rect></div>
<pre id=out></pre>
<script>
function handle(e) {
var out = document.getElementById('out');
out.innerHTML = e.type + ' @ ' + e.offsetX + ',' + e.y + '\n' + out.innerHTML;
}
var rect = document.getElementById('rect');
rect.onmousedown = handle;
rect.onmousemove = handle;
rect.onmouseup = handle;
rect.onclick = handle;
rect.ondblclick = handle;
</script>