mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00: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:
parent
c1596192fa
commit
4dc65c57a0
Notes:
github-actions[bot]
2024-12-13 06:19:51 +00:00
Author: https://github.com/Psychpsyo
Commit: 4dc65c57a0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2372
Reviewed-by: https://github.com/kalenikaliaksandr
3 changed files with 58 additions and 4 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue