mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
Tests/LibWeb: Add hit test for border-radius clip
This test demonstrates that hit testing incorrectly hits elements in areas clipped by border-radius. The corner point (5,5) should not hit the target element because it falls outside the rounded corner, but currently it does.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
44bfb32d47
commit
0db9ce6131
Notes:
github-actions[bot]
2026-02-06 11:19:18 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/0db9ce61310 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7568 Reviewed-by: https://github.com/gmta ✅
32
Tests/LibWeb/Text/input/hit-test-border-radius.html
Normal file
32
Tests/LibWeb/Text/input/hit-test-border-radius.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="include.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background: blue;
|
||||
border-radius: 50px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
// Corner at (5,5) - outside due to border-radius
|
||||
let hit1 = internals.hitTest(5, 5);
|
||||
// Inside ellipse curve
|
||||
let hit2 = internals.hitTest(25, 25);
|
||||
// Center
|
||||
let hit3 = internals.hitTest(100, 100);
|
||||
|
||||
println("Corner (5,5):");
|
||||
printElement(hit1.node);
|
||||
println("Near corner (25,25):");
|
||||
printElement(hit2.node);
|
||||
println("Center (100,100):");
|
||||
printElement(hit3.node);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user