mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +02:00
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.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
c1596192fa
commit
4dc65c57a0
Notes:
github-actions[bot]
2024-12-13 06:19:51 +00:00
Author: https://github.com/Psychpsyo Commit: https://github.com/LadybirdBrowser/ladybird/commit/4dc65c57a0d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2372 Reviewed-by: https://github.com/kalenikaliaksandr
@@ -0,0 +1,21 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user