Files
ladybird/Tests/LibWeb/Text/input/UIEvents/label-double-click-toggles-twice.html
Zaggy1024 bdda60f9c8 LibWeb: Only skip labels' controls' activations on the first click
Chromium and Firefox skip calling the activation behavior on the first
click, so that double clicking toggles checkboxes twice.

Also, activation behaviors may be triggered by spacebar in the future,
so this check is limited to click events.
2026-03-17 04:01:29 -05:00

26 lines
726 B
HTML

<!DOCTYPE html>
<style>
body {
margin: 0;
width: 200px;
height: 200px;
}
</style>
<label id="label"><input type="checkbox" id="checkbox"> Check me</label>
<script src="../include.js"></script>
<script>
test(() => {
println(`initial: ${checkbox.checked}`);
// Single click on the label text (not directly on the checkbox).
internals.click(60, 10);
println(`after single click: ${checkbox.checked}`);
// Double click on the label text. Both clicks should toggle the checkbox,
// resulting in the original state.
internals.click(60, 10, 1);
internals.click(60, 10, 2);
println(`after double click: ${checkbox.checked}`);
});
</script>