mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Transform PaintableBox::hit_test positions
Elements with transforms were tested on their pre-transformed positions, causing incorrect hits. Copy the position transformation done in `StackingContext::hit_test` to ensure that hit tests are done on the _actual_ position.
This commit is contained in:
committed by
Alexander Kalenik
parent
d2ca522540
commit
a0fb092d94
Notes:
github-actions[bot]
2024-11-23 21:07:27 +00:00
Author: https://github.com/yyny Commit: https://github.com/LadybirdBrowser/ladybird/commit/a0fb092d942 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2534 Reviewed-by: https://github.com/kalenikaliaksandr
22
Tests/LibWeb/Text/input/hit_testing/css-transforms.html
Normal file
22
Tests/LibWeb/Text/input/hit_testing/css-transforms.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<div>
|
||||
<input id="input" type="text">
|
||||
<div id="div" style="position: absolute; transform: translate(0px, 42px);">
|
||||
This text should not be hit when clicking the input.
|
||||
</div>
|
||||
</div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
document.getElementById("input").addEventListener("click", () => {
|
||||
println("clicked the <input>");
|
||||
});
|
||||
document.getElementById("div").addEventListener("click", () => {
|
||||
println("clicked the <div>");
|
||||
});
|
||||
window.addEventListener("load", () => {
|
||||
internals.click(12, 12);
|
||||
done();
|
||||
})
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user