mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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:
committed by
Andreas Kling
parent
a7578164d4
commit
67981af276
@@ -0,0 +1,4 @@
|
||||
Radio button 1 initial checkedness: true
|
||||
Radio button 2 initial checkedness: false
|
||||
Radio button 1 checkedness: false
|
||||
Radio button 2 checkedness: true
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user