mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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.
26 lines
726 B
HTML
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>
|