Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <!-- Will set indeterminate state via JS --> | |
| 5 <input id="element1" type="checkbox" /> | |
| 6 <script> | |
| 7 // No way currently to do this via markup, must be via JS | |
| 8 document.getElementById('element1').indeterminate = true; | |
| 9 </script> | |
| 10 <!-- Control--> | |
| 11 <input id="element2" type="checkbox" /> | |
| 12 | |
| 13 <div> | |
| 14 <!-- Will be ::intederminate in CSS because no radio item selected yet --> | |
|
dmazzoni
2017/03/09 19:33:41
spelling
aleventhal
2017/03/09 21:40:49
Done.
| |
| 15 <input type="radio" name="radiogroup1" /> | |
| 16 <input id="element3" type="radio" name="radiogroup1" /> | |
| 17 </div> | |
| 18 | |
| 19 <div> | |
| 20 <!-- NOT mixed/intederminate because group has a selected radio button --> | |
|
dmazzoni
2017/03/09 19:33:41
same
aleventhal
2017/03/09 21:40:49
Done.
| |
| 21 <input id="element4" type="radio" name="radiogroup2" /> | |
| 22 <input id="element5" type="radio" checked name="radiogroup2" /> | |
| 23 </div> | |
| 24 | |
| 25 <script> | |
| 26 | |
| 27 function axElementById(id) { | |
| 28 return accessibilityController.accessibleElementById(id); | |
| 29 } | |
| 30 | |
| 31 test(function(t) { | |
| 32 var ax = axElementById("element1"); | |
| 33 assert_true(ax.isButtonStateMixed); | |
| 34 }, "A native indeterminate checkbox must have the mixed state"); | |
| 35 | |
| 36 test(function(t) { | |
| 37 var ax = axElementById("element2"); | |
| 38 assert_false(ax.isButtonStateMixed); | |
| 39 }, "A native checkbox that is not indeterminate" + | |
| 40 " must NOT have the mixed state"); | |
| 41 | |
| 42 test(function(t) { | |
| 43 var ax = axElementById("element3"); | |
| 44 assert_true(ax.isButtonStateMixed); | |
| 45 }, "A native radio that in a group with nothing checked" + | |
| 46 " must have the mixed state"); | |
| 47 | |
| 48 test(function(t) { | |
| 49 var ax = axElementById("element4"); | |
| 50 assert_false(ax.isButtonStateMixed); | |
| 51 }, "A native radio that in a group with something checked" + | |
| 52 " must NOT have the mixed state"); | |
| 53 | |
| 54 test(function(t) { | |
| 55 var ax = axElementById("element4"); | |
| 56 assert_false(ax.isButtonStateMixed); | |
| 57 }, "A checked native radio must NOT have the mixed state"); | |
| 58 </script> | |
| OLD | NEW |