Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 | |
| 5 <style> | |
| 6 .hideAllContainers .container { | |
| 7 display: none; | |
| 8 } | |
| 9 </style> | |
| 10 | |
| 11 <div class="container"> | |
| 12 <input id="button1" type="button"> | |
| 13 </div> | |
| 14 | |
| 15 <script> | |
| 16 test(function(t) { | |
| 17 var axButtonInput1 = accessibilityController.accessibleElementById("button1" ); | |
| 18 assert_equals(axButtonInput1.name, ""); | |
| 19 }, "Input button with no value"); | |
| 20 </script> | |
| 21 | |
| 22 <div class="container"> | |
| 23 <input id="button2" type="button" value="button-value2"> | |
| 24 </div> | |
| 25 | |
| 26 <script> | |
| 27 test(function(t) { | |
| 28 var axButtonInput2 = accessibilityController.accessibleElementById("button2" ); | |
| 29 assert_equals(axButtonInput2.name, "button-value2"); | |
| 30 assert_equals(axButtonInput2.nameFrom, "attribute"); | |
| 31 }, "Input button with value"); | |
| 32 </script> | |
| 33 | |
| 34 <div class="container"> | |
| 35 <input id="button3" type="button" value="button-value3" title="button-title3 "> | |
| 36 </div> | |
| 37 | |
| 38 <script> | |
| 39 test(function(t) { | |
| 40 var axButtonInput3 = accessibilityController.accessibleElementById("button3" ); | |
| 41 assert_equals(axButtonInput3.name, "button-value3"); | |
| 42 assert_equals(axButtonInput3.nameFrom, "attribute"); | |
| 43 }, "Input button with value and title"); | |
| 44 </script> | |
| 45 | |
| 46 <div class="container"> | |
| 47 <input id="button4" type="button" title="button-title4"> | |
| 48 </div> | |
| 49 | |
| 50 <script> | |
| 51 test(function(t) { | |
| 52 var axButtonInput4 = accessibilityController.accessibleElementById("button4" ); | |
| 53 assert_equals(axButtonInput4.name, "button-title4"); | |
| 54 assert_equals(axButtonInput4.nameFrom, "attribute"); | |
| 55 }, "Input button with title only"); | |
| 56 </script> | |
| 57 | |
| 58 <div class="container"> | |
| 59 <input id="button5" type="button"> | |
| 60 <label for="button5">button-label-5</label> | |
| 61 </div> | |
| 62 | |
| 63 <script> | |
| 64 test(function(t) { | |
| 65 var axButtonInput5 = accessibilityController.accessibleElementById("button5" ); | |
| 66 assert_equals(axButtonInput5.name, "button-label-5"); | |
| 67 assert_equals(axButtonInput5.nameFrom, "relatedElement"); | |
| 68 }, "Input button with label for= and no value"); | |
| 69 </script> | |
| 70 | |
| 71 <div class="container"> | |
| 72 <input id="button6" type="button"> | |
| 73 <label for="button6">button-label-6</label> | |
| 74 </div> | |
| 75 | |
| 76 <script> | |
| 77 test(function(t) { | |
| 78 var axButtonInput6 = accessibilityController.accessibleElementById("button6" ); | |
| 79 assert_equals(axButtonInput6.name, "button-label-6"); | |
| 80 assert_equals(axButtonInput6.nameFrom, "relatedElement"); | |
| 81 }, "Input button with label wrapped and no value"); | |
|
dmazzoni
2015/08/24 18:02:03
Did you mean for the <label> to wrap the <input> h
aboxhall
2015/08/25 02:45:53
Oops!
Fixing this uncovered an infinite loop issu
| |
| 82 </script> | |
| 83 | |
| 84 <div class="container"> | |
| 85 <input id="button7" type="button" value="button-value7"> | |
| 86 <label for="button7">button-label-7</label> | |
| 87 </div> | |
| 88 | |
| 89 <script> | |
| 90 test(function(t) { | |
| 91 var axButtonInput7 = accessibilityController.accessibleElementById("button7" ); | |
| 92 assert_equals(axButtonInput7.name, "button-label-7"); | |
| 93 assert_equals(axButtonInput7.nameFrom, "relatedElement"); | |
| 94 }, "Input button with label for= and value"); | |
| 95 </script> | |
| 96 | |
| 97 <div class="container"> | |
| 98 <input id="button8" type="button" value="button-value8" aria-label="button-a ria-label-8"> | |
| 99 <label for="button8">button-label-8</label> | |
| 100 </div> | |
| 101 | |
| 102 <script> | |
| 103 test(function(t) { | |
| 104 var axButtonInput8 = accessibilityController.accessibleElementById("button8" ); | |
| 105 assert_equals(axButtonInput8.name, "button-aria-label-8"); | |
| 106 assert_equals(axButtonInput8.nameFrom, "attribute"); | |
| 107 }, "Input button with label for= and aria-label"); | |
| 108 </script> | |
| 109 | |
| 110 <div class="container"> | |
| 111 <input id="button9" type="button" value="button-value9" aria-label="button-a ria-label-9" aria-labelledby="label-for-button9"> | |
| 112 <label for="button9">button-label-9</label> | |
| 113 <span id="label-for-button9">button9-aria-labelledby</span> | |
| 114 </div> | |
| 115 | |
| 116 <script> | |
| 117 test(function(t) { | |
| 118 var axButtonInput9 = accessibilityController.accessibleElementById("button9" ); | |
| 119 assert_equals(axButtonInput9.name, "button9-aria-labelledby"); | |
| 120 assert_equals(axButtonInput9.nameFrom, "relatedElement"); | |
| 121 }, "Input button with label for=, aria-label and aria-labelledby"); | |
| 122 </script> | |
| 123 | |
| 124 <div class="container"> | |
| 125 <input id="submit1" type="submit"> | |
| 126 </div> | |
| 127 | |
| 128 <script> | |
| 129 test(function(t) { | |
| 130 var axSubmitButton1 = accessibilityController.accessibleElementById("submit1 "); | |
| 131 assert_equals(axSubmitButton1.name, "Submit"); | |
| 132 assert_equals(axSubmitButton1.nameFrom, "contents"); | |
| 133 }, "Submit button without value"); | |
| 134 </script> | |
| 135 | |
| 136 <div class="container"> | |
| 137 <input id="submit2" type="submit" value="submit-value2"> | |
| 138 </div> | |
| 139 | |
| 140 <script> | |
| 141 test(function(t) { | |
| 142 var axSubmitButton2 = accessibilityController.accessibleElementById("submit2 "); | |
| 143 assert_equals(axSubmitButton2.name, "submit-value2"); | |
| 144 assert_equals(axSubmitButton2.nameFrom, "attribute"); | |
| 145 }, "Submit button with value"); | |
| 146 </script> | |
| 147 | |
| 148 <div class="container"> | |
| 149 <input id="submit3" type="submit" title="submit-title"> | |
| 150 </div> | |
| 151 | |
| 152 <script> | |
| 153 test(function(t) { | |
| 154 var axSubmitButton3 = accessibilityController.accessibleElementById("submit3 "); | |
| 155 assert_equals(axSubmitButton3.name, "Submit"); | |
| 156 assert_equals(axSubmitButton3.nameFrom, "contents"); | |
| 157 }, "Submit button with title only"); | |
| 158 </script> | |
| 159 | |
| 160 <div class="container"> | |
| 161 <input id="reset1" type="reset"> | |
| 162 </div> | |
| 163 | |
| 164 <script> | |
| 165 test(function(t) { | |
| 166 var axResetButton1 = accessibilityController.accessibleElementById("reset1") ; | |
| 167 assert_equals(axResetButton1.name, "Reset"); | |
| 168 assert_equals(axResetButton1.nameFrom, "contents"); | |
| 169 }, "Reset button with no value"); | |
| 170 </script> | |
| 171 | |
| 172 <div class="container"> | |
| 173 <input id="image-input1" type="image" src="resources/cake.png"> | |
| 174 </div> | |
| 175 | |
| 176 <script> | |
| 177 test(function(t) { | |
| 178 var axImageInput1 = accessibilityController.accessibleElementById("image-inp ut1"); | |
| 179 assert_equals(axImageInput1.name, "Submit"); | |
| 180 assert_equals(axImageInput1.nameFrom, "attribute"); | |
| 181 }, "Image input with no value"); | |
| 182 </script> | |
| 183 | |
| 184 <div class="container"> | |
| 185 <input id="image-input2" type="image" src="resources/cake.png" value="image- input-value2"> | |
| 186 </div> | |
| 187 | |
| 188 <script> | |
| 189 test(function(t) { | |
| 190 var axImageInput2 = accessibilityController.accessibleElementById("image-inp ut2"); | |
| 191 assert_equals(axImageInput2.name, "image-input-value2"); | |
| 192 assert_equals(axImageInput2.nameFrom, "attribute"); | |
| 193 }, "Image input with value"); | |
| 194 </script> | |
| 195 | |
| 196 <div class="container"> | |
| 197 <input id="image-input3" type="image" src="resources/cake.png" alt="image-in put-alt3"> | |
| 198 </div> | |
| 199 | |
| 200 <script> | |
| 201 test(function(t) { | |
| 202 var axImageInput3 = accessibilityController.accessibleElementById("image-inp ut3"); | |
| 203 assert_equals(axImageInput3.name, "image-input-alt3"); | |
| 204 assert_equals(axImageInput3.nameFrom, "attribute"); | |
| 205 }, "Image input with alt"); | |
| 206 </script> | |
| 207 | |
| 208 <div class="container"> | |
| 209 <input id="image-input4" type="image" src="resources/cake.png" alt="image-in put-alt4" value="image-input-value4"> | |
| 210 </div> | |
| 211 | |
| 212 <script> | |
| 213 test(function(t) { | |
| 214 var axImageInput4 = accessibilityController.accessibleElementById("image-inp ut4"); | |
| 215 assert_equals(axImageInput4.name, "image-input-alt4"); | |
| 216 assert_equals(axImageInput4.nameFrom, "attribute"); | |
| 217 }, "Image input with alt and value"); | |
| 218 </script> | |
| 219 | |
| 220 <div class="container"> | |
| 221 <input id="image-input5" type="image" src="resources/cake.png" title="image- input-title5"> | |
| 222 </div> | |
| 223 | |
| 224 <script> | |
| 225 test(function(t) { | |
| 226 var axImageInput5 = accessibilityController.accessibleElementById("image-inp ut5"); | |
| 227 assert_equals(axImageInput5.name, "Submit"); | |
|
dmazzoni
2015/08/24 18:02:03
Why is this Submit?
aboxhall
2015/08/25 02:45:53
Yeah, you figured it out :)
The slight weirdness i
| |
| 228 assert_equals(axImageInput5.nameFrom, "attribute"); | |
| 229 }, "Image input with title only"); | |
| 230 </script> | |
| 231 | |
| 232 <script> | |
| 233 if (window.testRunner) | |
| 234 document.body.className = "hideAllContainers"; | |
| 235 </script> | |
| OLD | NEW |