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:
Jonne Ransijn
2024-11-23 20:32:07 +01:00
committed by Alexander Kalenik
parent d2ca522540
commit a0fb092d94
Notes: github-actions[bot] 2024-11-23 21:07:27 +00:00
3 changed files with 42 additions and 12 deletions

View 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>