1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-05 08:57:35 +00:00
serenity/Tests/LibWeb/Text/input/hit_testing/button.html
Aliaksandr Kalenik edab67d5e8 LibWeb: Fix hit-testing for button element
Change 'dom_node_for_event_dispatch' to locate the closest layout node
with a DOM node instead of only checking the direct ancestor.

This fixes hit-testing for buttons because they are wrapped into
multiple anonymous layout nodes (internally we use flex formatting for
them).
2024-02-13 14:22:14 +01:00

21 lines
467 B
HTML

<!DOCTYPE html>
<style>
#btn {
background-color: gold;
font-size: 100px;
width: 500px;
border: none;
}
</style>
<script src="../include.js"></script>
<button type="submit" id="btn">Button</button>
<script>
asyncTest(done => {
const brn = document.getElementById("btn");
btn.onclick = () => {
println("Clicked!");
done();
};
internals.click(50, 50);
});
</script>