blob: 80f0813419f798d844490e46b41cf3fcc723a71b [file] [log] [blame]
<html>
<head>
<script>
function test() {
if (window.testRunner)
testRunner.dumpAsText();
var r1 = document.getElementById('r1');
verifyCheckedState(r1, true);
r1.checked = false;
verifyCheckedState(r1, false);
r1.checked = true;
verifyCheckedState(r1, true);
r1.checked = false;
verifyCheckedState(r1, false);
document.getElementById('fr').reset();
verifyCheckedState(r1, true);
var r2 = document.getElementById('r2');
// Attempt to check with the spacebar
r2.focus();
if (window.testRunner) {
eventSender.keyDown(' ');
}
verifyCheckedState(r2, true);
var r3 = document.getElementById('r3');
// Attempt to check with the mouse
if (window.testRunner) {
eventSender.mouseMoveTo(r3.offsetLeft + 7, r3.offsetTop + 7);
eventSender.mouseDown();
eventSender.mouseUp();
}
verifyCheckedState(r3, true);
}
function verifyCheckedState(rad, expected) {
if (rad.checked == expected)
log("Pass");
else
log("Fail");
}
function log(msg) {
var console = document.getElementById('console');
console.innerHTML = console.innerHTML + msg + "<br>";
}
</script>
</head>
<body onload="test()">
There was once a WinIE quirk that did not allow a user to select radio buttons that did't have names.
However, this was changed in a later version, and WinIE now allows users to select nameless radio buttons.
This tests that we allow unnamed radio buttons to be selected.<br>
<br>
<form id="fr">
<input type="radio" id="r1" checked>
<input type="radio" id="r2">
<input type="radio" id="r3">
</form>
<div id='console'></div>
</body>
</html>