mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Add hit testing API in internals object
Introduces `internals.hitTest(x, y)` that is going to allow us write tests for hit testing :)
This commit is contained in:
committed by
Andreas Kling
parent
22a858a0cb
commit
bf4e2f3e9c
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/bf4e2f3e9c Pull-request: https://github.com/SerenityOS/serenity/pull/20440 Reviewed-by: https://github.com/awesomekling
17
Tests/LibWeb/Text/input/hit_testing/basic.html
Normal file
17
Tests/LibWeb/Text/input/hit_testing/basic.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<style>
|
||||
* {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
#box {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="box"></div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println(internals.hitTest(50, 50).node === document.getElementById("box"));
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user