| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body id="body"> | 6 <body id="body"> |
| 7 | 7 |
| 8 <span id="labelShutdown"><label id="labelElement" for="shutdownTime">Shut down c
omputer after</label></span> | 8 <span id="labelShutdown"><label id="labelElement" for="shutdownTime">Shut down c
omputer after</label></span> |
| 9 <input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown s
hutdownTime shutdownUnit" /> | 9 <input id="shutdownTime" type="text" value="10" aria-labelledby="labelShutdown s
hutdownTime shutdownUnit" /> |
| 10 <span id="shutdownUnit">minutes</span> | 10 <span id="shutdownUnit">minutes</span> |
| 11 | 11 |
| 12 <p id="description"></p> | 12 <p id="description"></p> |
| 13 <div id="console"></div> | 13 <div id="console"></div> |
| 14 | 14 |
| 15 <script> | 15 <script> |
| 16 | 16 |
| 17 description("This tests that if aria-labelledby is used, then label elements
are not used"); | 17 description("This tests that if aria-labelledby is used, then label elements
are not used"); |
| 18 | 18 |
| 19 if (window.accessibilityController) { | 19 if (window.accessibilityController) { |
| 20 | 20 |
| 21 var text = document.getElementById("shutdownTime"); | 21 var text = document.getElementById("shutdownTime"); |
| 22 text.focus(); | 22 text.focus(); |
| 23 text = accessibilityController.focusedElement; | 23 text = accessibilityController.focusedElement; |
| 24 | 24 |
| 25 shouldBe("text.description", "'AXDescription: Shut down computer after
10 minutes'"); | 25 shouldBe("text.deprecatedDescription", "'AXDescription: Shut down comp
uter after 10 minutes'"); |
| 26 | 26 |
| 27 // There should be no title UI element. | 27 // There should be no title UI element. |
| 28 shouldBe("text.titleUIElement() != null && text.titleUIElement().isVal
id", "false"); | 28 shouldBe("text.deprecatedTitleUIElement() != null && text.deprecatedTi
tleUIElement().isValid", "false"); |
| 29 | 29 |
| 30 var labelElement = accessibilityController.accessibleElementById("labe
lElement"); | 30 var labelElement = accessibilityController.accessibleElementById("labe
lElement"); |
| 31 // This just makes sure that the label element is still visible in the
AX hierarchy, even though | 31 // This just makes sure that the label element is still visible in the
AX hierarchy, even though |
| 32 // it's a label element (sometimes they are ignored). | 32 // it's a label element (sometimes they are ignored). |
| 33 debug("Label element role is: " + labelElement.role); | 33 debug("Label element role is: " + labelElement.role); |
| 34 } | 34 } |
| 35 | 35 |
| 36 </script> | 36 </script> |
| 37 | 37 |
| 38 </body> | 38 </body> |
| 39 </html> | 39 </html> |
| OLD | NEW |