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 <input type="text" aria-disabled="true" size=20> | 7 <input id="text1" type="text" aria-disabled="true" size=20> |
8 <input type="text" aria-disabled="false" size=20> | 8 <input id="text2" type="text" aria-disabled="false" size=20> |
9 <div role="group" id="group1" aria-disabled="true"> | 9 <div role="group" id="group1" aria-disabled="true"> |
10 <div role="group"> | 10 <div role="group"> |
11 <a id="link1" href="#">link</a> | 11 <a id="link1" href="#">link</a> |
12 <button id="button1" type="submit" aria-disabled="false">submit</button> | 12 <button id="button1" type="submit" aria-disabled="false">submit</button> |
13 <div> | 13 <div> |
14 <div> | 14 <div> |
15 </div> | 15 </div> |
16 <p id="description"></p> | 16 <p id="description"></p> |
17 <div id="console"></div> | 17 <div id="console"></div> |
18 | 18 |
19 <script> | 19 <script> |
20 | 20 |
21 description("This tests that the aria-disabled attribute works. The text fie
ld should not be enabled."); | 21 description("This tests that the aria-disabled attribute works. The text fie
ld should not be enabled."); |
22 | 22 |
23 if (window.accessibilityController) { | 23 if (window.accessibilityController) { |
24 | 24 |
25 var body = document.getElementById("body"); | 25 var textField = accessibilityController.accessibleElementById("text1")
; |
26 body.focus(); | |
27 var textField = accessibilityController.focusedElement.childAtIndex(0)
.childAtIndex(0); | |
28 shouldBe("textField.isEnabled", "false"); | 26 shouldBe("textField.isEnabled", "false"); |
29 | 27 |
30 textField = accessibilityController.focusedElement.childAtIndex(0).chi
ldAtIndex(1); | 28 textField = accessibilityController.accessibleElementById("text2"); |
31 shouldBe("textField.isEnabled", "true"); | 29 shouldBe("textField.isEnabled", "true"); |
32 | 30 |
33 var group = accessibilityController.accessibleElementById("group1"); | 31 var group = accessibilityController.accessibleElementById("group1"); |
34 shouldBe("group.isEnabled", "false"); | 32 shouldBe("group.isEnabled", "false"); |
35 | 33 |
36 var link = accessibilityController.accessibleElementById("link1"); | 34 var link = accessibilityController.accessibleElementById("link1"); |
37 shouldBe("link.isEnabled", "false"); | 35 shouldBe("link.isEnabled", "false"); |
38 | 36 |
39 var button = accessibilityController.accessibleElementById("button1"); | 37 var button = accessibilityController.accessibleElementById("button1"); |
40 shouldBe("button.isEnabled", "true"); | 38 shouldBe("button.isEnabled", "true"); |
41 } | 39 } |
42 | 40 |
43 </script> | 41 </script> |
44 | 42 |
45 </body> | 43 </body> |
46 </html> | 44 </html> |
OLD | NEW |