3 <script src=
"../../../resources/js-test.js"></script>
7 <input id=
"r1_1" type=
"radio">
9 <input id=
"r2_1" name=
"r2" type=
"radio">
10 <input id=
"r2_2" name=
"r2" type=
"radio">
11 <input id=
"r2_3" name=
"r2" type=
"radio">
13 <input id=
"r3_1" name=
"r3" checked
type=
"radio">
15 <input id=
"r4_1" name=
"r4" type=
"radio">
16 <input id=
"r4_2" name=
"r4" type=
"radio">
19 description('This tests :indeterminate pseudo class matches when there is no checked radio button in a radio button group.');
22 r1_1
= document
.getElementById('r1_1');
23 debug('If a name isn\'t specified, it is in its own radio group.');
24 shouldBeTrue('r1_1.matches(":indeterminate")');
25 debug('Setting indeterminate property shouldn\'t affect radio buttons.');
26 r1_1
.indeterminate
= true;
27 shouldBeTrue('r1_1.matches(":indeterminate")');
29 shouldBeFalse('r1_1.matches(":indeterminate")');
30 r1_1
.indeterminate
= false;
31 shouldBeFalse('r1_1.matches(":indeterminate")');
35 debug('Changing checked should affect the matching of other buttons within the radio group.');
36 r2_1
= document
.getElementById('r2_1');
37 r2_2
= document
.getElementById('r2_2');
38 r2_3
= document
.getElementById('r2_3');
39 shouldBeTrue('r2_1.matches(":indeterminate")');
40 shouldBeTrue('r2_2.matches(":indeterminate")');
41 shouldBeTrue('r2_3.matches(":indeterminate")');
43 shouldBeFalse('r2_1.matches(":indeterminate")');
44 shouldBeFalse('r2_2.matches(":indeterminate")');
45 shouldBeFalse('r2_3.matches(":indeterminate")');
47 shouldBeFalse('r2_1.matches(":indeterminate")');
48 shouldBeFalse('r2_2.matches(":indeterminate")');
49 shouldBeFalse('r2_3.matches(":indeterminate")');
51 shouldBeTrue('r2_1.matches(":indeterminate")');
52 shouldBeTrue('r2_2.matches(":indeterminate")');
53 shouldBeTrue('r2_3.matches(":indeterminate")');
57 debug('Adding/removing a button from a group should affect the matching.');
58 r3_1
= document
.getElementById('r3_1');
59 r4_1
= document
.getElementById('r4_1');
60 r4_2
= document
.getElementById('r4_2');
61 shouldBeFalse('r3_1.matches(":indeterminate")');
62 shouldBeTrue('r4_1.matches(":indeterminate")');
63 shouldBeTrue('r4_2.matches(":indeterminate")');
65 shouldBeFalse('r3_1.matches(":indeterminate")');
66 shouldBeFalse('r4_1.matches(":indeterminate")');
67 shouldBeFalse('r4_2.matches(":indeterminate")');
69 shouldBeFalse('r3_1.matches(":indeterminate")');
70 shouldBeTrue('r4_1.matches(":indeterminate")');
71 shouldBeTrue('r4_2.matches(":indeterminate")');