test_formctrl.html (3082B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <title>HTML form controls tests</title> 6 <link rel="stylesheet" type="text/css" 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 11 <script type="application/javascript" 12 src="../common.js"></script> 13 <script type="application/javascript" 14 src="../role.js"></script> 15 16 <script type="application/javascript"> 17 function doTest() { 18 // input@type="checkbox" 19 var accTree = { 20 role: ROLE_CHECKBUTTON, 21 children: [ ], 22 }; 23 24 testAccessibleTree("checkbox", accTree); 25 26 // input@type="radio" 27 accTree = { 28 role: ROLE_RADIOBUTTON, 29 children: [ ], 30 }; 31 32 testAccessibleTree("radio", accTree); 33 34 // input@type="button" and input@type="submit" 35 // button 36 accTree = { 37 role: ROLE_PUSHBUTTON, 38 children: [ 39 { 40 role: ROLE_TEXT_LEAF, // XXX Bug 567203 41 }, 42 ], 43 }; 44 45 testAccessibleTree("btn1", accTree); 46 testAccessibleTree("submit", accTree); 47 testAccessibleTree("btn2", accTree); 48 49 // input@type="image" 50 accTree = { 51 role: ROLE_PUSHBUTTON, 52 children: [ 53 { 54 role: ROLE_STATICTEXT, 55 }, 56 ], 57 }; 58 testAccessibleTree("image_submit", accTree); 59 60 // input@type="range" 61 accTree = { SLIDER: [ ] }; 62 testAccessibleTree("range", accTree); 63 64 // input@type="number" 65 accTree = { SPINBUTTON: [ ] }; 66 testAccessibleTree("number", accTree); 67 68 // output 69 accTree = { 70 role: ROLE_STATUSBAR, 71 children: [ 72 { 73 role: ROLE_TEXT_LEAF, 74 }, 75 ], 76 }; 77 testAccessibleTree("output", accTree); 78 79 SimpleTest.finish(); 80 } 81 82 SimpleTest.waitForExplicitFinish(); 83 addA11yLoadEvent(doTest); 84 </script> 85 </head> 86 <body> 87 88 <a target="_blank" 89 title="Fix O(n^2) access to all the children of a container" 90 href="https://bugzilla.mozilla.org/show_bug.cgi?id=342045"> 91 Bug 342045 92 </a> 93 <a target="_blank" 94 title="add test for role of input type='image'" 95 href="https://bugzilla.mozilla.org/show_bug.cgi?id=524521"> 96 Bug 524521 97 </a> 98 <a target="_blank" 99 href="https://bugzilla.mozilla.org/show_bug.cgi?id=558036" 100 title="make HTML <output> accessible"> 101 Bug 558036 102 </a> 103 <a target="_blank" 104 href="https://bugzilla.mozilla.org/show_bug.cgi?id=559764" 105 title="make HTML5 input@type=range element accessible"> 106 Bug 559764 107 </a> 108 <p id="display"></p> 109 <div id="content" style="display: none"></div> 110 <pre id="test"> 111 </pre> 112 113 <input type="checkbox" id="checkbox"> 114 <input type="radio" id="radio"> 115 <input type="button" value="button" id="btn1"> 116 <button id="btn2">button</button> 117 118 <input type="submit" id="submit"> 119 <input type="image" id="image_submit"> 120 <input type="range" id="range"> 121 <input type="number" id="number"> 122 <output id="output">1337</output> 123 124 </body> 125 </html>