LibWeb: Don't group radio buttons from different trees together

Previously, we were searching for other radio buttons from the document
root, rather than the element root.
This commit is contained in:
Tim Ledbetter 2024-09-10 23:51:24 +01:00 committed by Andreas Kling
parent a7578164d4
commit 67981af276
Notes: github-actions[bot] 2024-09-11 06:00:20 +00:00
3 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const container = document.createElement("div");
container.innerHTML =
`<form>
<input type="radio" name="group1" id="radio1" checked>
<input type="radio" name="group1" id="radio2">
</form>`;
const radio1 = container.querySelector("#radio1");
const radio2 = container.querySelector("#radio2");
println(`Radio button 1 initial checkedness: ${radio1.checked}`);
println(`Radio button 2 initial checkedness: ${radio2.checked}`);
radio2.checked = true;
println(`Radio button 1 checkedness: ${radio1.checked}`);
println(`Radio button 2 checkedness: ${radio2.checked}`);
});
</script>