cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 | <html> |
| 3 | <head> |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 4 | <script src="../resources/js-test-pre.js"></script> |
cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 5 | </head> |
| 6 | <body id="body"> |
| 7 | |
| 8 | <ul id="tablist_1" role="tablist"> |
| 9 | <li id="tab_1" role="tab" tabindex="0" class="">Crust</li> |
| 10 | <li id="tab_2" role="tab" tabindex="0" class="">Veges</li> |
| 11 | </ul> |
| 12 | |
| 13 | <div id="panel_1" role="tabpanel" aria-labelledby="tab_1" > |
| 14 | <h3>Select Crust</h3> |
| 15 | </div> |
| 16 | |
| 17 | |
| 18 | <p id="description"></p> |
| 19 | <div id="console"></div> |
| 20 | |
| 21 | <script> |
| 22 | |
| 23 | description("This tests that the aria roles for tab, tabpanel and tablist work as expected correctly."); |
| 24 | |
| 25 | if (window.accessibilityController) { |
| 26 | |
| 27 | var body = document.getElementById("body"); |
| 28 | body.focus(); |
| 29 | |
| 30 | var tabList = accessibilityController.focusedElement.childAtIndex(0); |
| 31 | var tab1 = tabList.childAtIndex(0); |
| 32 | var tab2 = tabList.childAtIndex(1); |
| 33 | var tabPanel = accessibilityController.focusedElement.childAtIndex(1); |
| 34 | |
dmazzoni@google.com | 4b5ba0a | 2012-10-09 23:15:21 +0000 | [diff] [blame] | 35 | debug("tabList.role = " + tabList.role); |
| 36 | debug("tab1.role = " + tab1.role); |
bfulgham@apple.com | 1faa176 | 2013-06-24 20:46:38 +0000 | [diff] [blame] | 37 | debug("tab1.title = " + tab1.title); |
cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 38 | shouldBe("tab1.childrenCount", "0"); |
dmazzoni@google.com | 4b5ba0a | 2012-10-09 23:15:21 +0000 | [diff] [blame] | 39 | debug("tab2.role = " + tab2.role); |
bfulgham@apple.com | 1faa176 | 2013-06-24 20:46:38 +0000 | [diff] [blame] | 40 | debug("tab2.title = " + tab2.title); |
dmazzoni@google.com | 4b5ba0a | 2012-10-09 23:15:21 +0000 | [diff] [blame] | 41 | debug("tabPanel.role = " + tabPanel.role); |
| 42 | debug("tabPanel.subrole = " + tabPanel.subrole); |
cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 43 | } |
| 44 | |
cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 45 | </script> |
| 46 | |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame] | 47 | <script src="../resources/js-test-post.js"></script> |
cfleizach@apple.com | 60f0160 | 2009-11-02 16:57:47 +0000 | [diff] [blame] | 48 | </body> |
| 49 | </html> |