OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <style> | 5 <style> |
6 .hideAllContainers .container { | 6 .hideAllContainers .container { |
7 display: none; | 7 display: none; |
8 } | 8 } |
9 </style> | 9 </style> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 <script> | 106 <script> |
107 test(function(t) { | 107 test(function(t) { |
108 var axTextInput8 = accessibilityController.accessibleElementById("text8"); | 108 var axTextInput8 = accessibilityController.accessibleElementById("text8"); |
109 assert_equals(axTextInput8.name, ""); | 109 assert_equals(axTextInput8.name, ""); |
110 }, "Text input with wrapped label with wrong ID"); | 110 }, "Text input with wrapped label with wrong ID"); |
111 </script> | 111 </script> |
112 | 112 |
113 <div class="container"> | 113 <div class="container"> |
114 <label for="text9">label-for-text9</label> | 114 <label for="text9">label-for-text9</label> |
115 <label>label-wrapping-text9 | 115 <label>label-wrapping-text9<input id="text9" type="text" title="text9-title"
placeholder="text9-placeholder"></label> |
116 <input id="text9" type="text" title="text9-title" placeholder="text9-pla
ceholder"> | |
117 </label> | |
118 </div> | 116 </div> |
119 | 117 |
120 <script> | 118 <script> |
121 test(function(t) { | 119 test(function(t) { |
122 var axTextInput9 = accessibilityController.accessibleElementById("text9"); | 120 var axTextInput9 = accessibilityController.accessibleElementById("text9"); |
123 assert_equals(axTextInput9.name, "label-for-text9"); | 121 assert_equals(axTextInput9.name, |
| 122 "label-for-text9 label-wrapping-text9"); |
124 assert_equals(axTextInput9.nameFrom, "relatedElement"); | 123 assert_equals(axTextInput9.nameFrom, "relatedElement"); |
125 }, "Text input with title, placeholder, label-for and label-wrapped"); | 124 }, "Text input with title, placeholder, label-for and label-wrapped"); |
126 </script> | 125 </script> |
127 | 126 |
128 <div class="container"> | 127 <div class="container"> |
129 <label>label-wrapping-text10<input id="text10" type="text" title="text10-tit
le" placeholder="text10-placeholder"> | 128 <label>label-wrapping-text10<input id="text10" type="text" title="text10-tit
le" placeholder="text10-placeholder"> |
130 </label> | 129 </label> |
131 </div> | 130 </div> |
132 | 131 |
133 <script> | 132 <script> |
134 test(function(t) { | 133 test(function(t) { |
135 var axTextInput10 = accessibilityController.accessibleElementById("text10"); | 134 var axTextInput10 = accessibilityController.accessibleElementById("text10"); |
136 assert_equals(axTextInput10.name, "label-wrapping-text10"); | 135 assert_equals(axTextInput10.name, "label-wrapping-text10"); |
137 assert_equals(axTextInput10.nameFrom, "relatedElement"); | 136 assert_equals(axTextInput10.nameFrom, "relatedElement"); |
138 assert_equals(axTextInput10.description, "text10-placeholder"); | 137 assert_equals(axTextInput10.description, "text10-placeholder"); |
139 assert_equals(axTextInput10.descriptionFrom, "placeholder"); | 138 assert_equals(axTextInput10.descriptionFrom, "placeholder"); |
140 }, "Text input with placeholder and label-wrapped"); | 139 }, "Text input with placeholder and label-wrapped"); |
141 </script> | 140 </script> |
142 | 141 |
| 142 <div class="container"> |
| 143 <input id="text11" type="text"> |
| 144 <label for="text11">first-label-for-text11</label> |
| 145 <label for="text11">second-label-for-text11</label> |
| 146 </div> |
| 147 |
| 148 <script> |
| 149 test(function(t) { |
| 150 var axTextInput11 = accessibilityController.accessibleElementById("text11"); |
| 151 assert_equals(axTextInput11.name, |
| 152 "first-label-for-text11 second-label-for-text11"); |
| 153 assert_equals(axTextInput11.nameFrom, "relatedElement"); |
| 154 }, "Text input with multiple label-for"); |
| 155 </script> |
143 | 156 |
144 <script> | 157 <script> |
145 if (window.testRunner) | 158 if (window.testRunner) |
146 document.body.className = "hideAllContainers"; | 159 document.body.className = "hideAllContainers"; |
147 </script> | 160 </script> |
OLD | NEW |