1
0
Fork 0
firefox/testing/web-platform/tests/inert/inert-form-control.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

34 lines
1.1 KiB
HTML

<!doctype html>
<meta charset="utf-8">
<link rel="help" href="https://html.spec.whatwg.org/#inert-subtrees">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1926304">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<title>Inert doesn't prevent initiated click from changing form control</title>
<style>
label {
display: block
}
</style>
<div id="ancestor">
<label>
<input type=radio name=foo value=1 checked> Something
</label>
<label id="target">
<input type=radio name=foo value=2> Something else
</label>
</div>
<script>
let targetInput = target.querySelector("input");
ancestor.addEventListener("click", () => {
ancestor.inert = true;
});
promise_test(async function () {
assert_false(targetInput.checked, "input shouldn't be checked");
await test_driver.click(target);
assert_true(ancestor.inert, "click handler should've ran");
assert_true(targetInput.checked, "input should become checked");
});
</script>