ladybird/Tests/LibWeb/Text/input/CSSOMView/mouse-event-offset-values.html
Psychpsyo 4dc65c57a0 LibWeb: Make MouseEvent.offsetX/Y ignore transforms
That is what the spec calls it, at least.
In code, this manifests as making the offset very aware
of the element's transform, because the click position comes
relative to the viewport, not to the transformed element.
2024-12-13 07:18:56 +01:00

21 lines
385 B
HTML

<!DOCTYPE html>
<style>
div {
width: 100px;
height: 100px;
background-color: gray;
transform: rotate(45deg);
}
</style>
<div onClick="
println(`offsetX: ${event.offsetX}`);
println(`offsetY: ${event.offsetY}`);
"></div>
<script src="../include.js"></script>
<script>
test(() => {
internals.click(50, 60);
});
</script>