| 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 <div role="listbox"> | 8 <div role="listbox"> |
| 9 <div role="option">option 1</div> | 9 <div role="option" tabindex="-1">option 1</div> |
| 10 <div role="option" aria-label="label 2">option 2</div> | 10 <div role="option" aria-label="label 2">option 2</div> |
| 11 </div> | 11 </div> |
| 12 | 12 |
| 13 <p id="description"></p> | 13 <p id="description"></p> |
| 14 <div id="console"></div> | 14 <div id="console"></div> |
| 15 | 15 |
| 16 <script> | 16 <script> |
| 17 | 17 |
| 18 description("This tests that the aria 'option' role works as expected. That
is, it becomes a static text element with no children."); | 18 description("This tests that the aria 'option' role works as expected. That
is, it becomes a static text element with no children."); |
| 19 | 19 |
| 20 if (window.accessibilityController) { | 20 if (window.accessibilityController) { |
| 21 | 21 |
| 22 var body = document.getElementById("body"); | 22 var body = document.getElementById("body"); |
| 23 body.focus(); | 23 body.focus(); |
| 24 | 24 |
| 25 var listBox = accessibilityController.focusedElement.childAtIndex(0); | 25 var listBox = accessibilityController.focusedElement.childAtIndex(0); |
| 26 var firstChild = listBox.childAtIndex(0); | 26 var firstChild = listBox.childAtIndex(0); |
| 27 var secondChild = listBox.childAtIndex(1); | 27 var secondChild = listBox.childAtIndex(1); |
| 28 debug("firstChild.role is " + firstChild.role); | 28 debug("firstChild.role is " + firstChild.role); |
| 29 shouldBe("firstChild.name", "'option 1'"); | 29 shouldBe("firstChild.name", "'option 1'"); |
| 30 | 30 |
| 31 debug("secondChild.role is " + secondChild.role); | 31 debug("secondChild.role is " + secondChild.role); |
| 32 shouldBe("secondChild.name", "'label 2'"); | 32 shouldBe("secondChild.name", "'label 2'"); |
| 33 | 33 |
| 34 shouldBe("firstChild.childrenCount", "0"); | 34 shouldBe("firstChild.childrenCount", "0"); |
| 35 shouldBe("secondChild.childrenCount", "0"); | 35 shouldBe("secondChild.childrenCount", "0"); |
| 36 |
| 37 shouldBe("firstChild.isFocusable", "true"); |
| 36 } | 38 } |
| 37 | 39 |
| 38 </script> | 40 </script> |
| 39 | 41 |
| 40 </body> | 42 </body> |
| 41 </html> | 43 </html> |
| OLD | NEW |