accessible/tests/mochitest/tree/test_aria_list.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:873c1a6ee59b
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>ARIA lists</title>
5 <link rel="stylesheet" type="text/css"
6 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
7
8 <script type="application/javascript"
9 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10
11 <script type="application/javascript"
12 src="../common.js"></script>
13 <script type="application/javascript"
14 src="../role.js"></script>
15
16 <script type="application/javascript">
17 function doTest()
18 {
19 //////////////////////////////////////////////////////////////////////////
20 // list
21
22 var accTree =
23 { LIST: [
24 { LISTITEM: [
25 { TEXT_LEAF: [ ] }
26 ] }
27 ] };
28
29 testAccessibleTree("list", accTree);
30
31 //////////////////////////////////////////////////////////////////////////
32 // crazy list (mad mix of ARIA and HTML)
33
34 accTree = { // div@role="list"
35 role: ROLE_LIST,
36 children: [
37 { // li text leaf
38 role: ROLE_TEXT_LEAF,
39 name: "item1",
40 children: [ ]
41 },
42 { // li@role="listitem"
43 role: ROLE_LISTITEM,
44 children: [
45 { // text leaf
46 role: ROLE_TEXT_LEAF,
47 name: "item2",
48 children: [ ]
49 }
50 ]
51 }
52 ]
53 };
54
55 testAccessibleTree("crazy_list", accTree);
56
57 SimpleTest.finish();
58 }
59
60 SimpleTest.waitForExplicitFinish();
61 addA11yLoadEvent(doTest);
62 </script>
63 </head>
64 <body>
65
66 <a target="_blank"
67 title="Build the context dependent tree"
68 href="https://bugzilla.mozilla.org/show_bug.cgi?id=804461">
69 Mozilla Bug 804461
70 </a>
71 <p id="display"></p>
72 <div id="content" style="display: none"></div>
73 <pre id="test">
74 </pre>
75
76 <div id="list" role="list">
77 <div role="listitem">item1</div>
78 </div>
79
80 <div id="crazy_list" role="list">
81 <ul role="presentation">
82 <li>item1</li>
83 <li role="listitem">item2</li>
84 </ul>
85 </div>
86 </body>
87 </html>

mercurial