|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 |
|
4 <head> |
|
5 <title>Table creation in ARIA dialog test</title> |
|
6 |
|
7 <link rel="stylesheet" type="text/css" |
|
8 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
9 |
|
10 <script type="application/javascript" |
|
11 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
12 |
|
13 <script type="application/javascript" |
|
14 src="../common.js"></script> |
|
15 <script type="application/javascript" |
|
16 src="../role.js"></script> |
|
17 <script type="application/javascript" |
|
18 src="../events.js"></script> |
|
19 |
|
20 <script type="application/javascript"> |
|
21 |
|
22 //////////////////////////////////////////////////////////////////////////// |
|
23 // Invokers |
|
24 |
|
25 function showARIADialog(aID) |
|
26 { |
|
27 this.node = getNode(aID); |
|
28 |
|
29 this.eventSeq = [ |
|
30 new invokerChecker(EVENT_SHOW, this.node) |
|
31 ]; |
|
32 |
|
33 this.invoke = function showARIADialog_invoke() |
|
34 { |
|
35 getNode("dialog").style.display = "block"; |
|
36 getNode("table").style.visibility = "visible"; |
|
37 getNode("a").textContent = "link"; |
|
38 getNode("input").value = "hello"; |
|
39 getNode("input").focus(); |
|
40 } |
|
41 |
|
42 this.finalCheck = function showARIADialog_finalCheck() |
|
43 { |
|
44 var tree = { |
|
45 role: ROLE_DIALOG, |
|
46 children: [ |
|
47 { |
|
48 role: ROLE_PUSHBUTTON, |
|
49 children: [ { role: ROLE_TEXT_LEAF } ] |
|
50 }, |
|
51 { |
|
52 role: ROLE_ENTRY |
|
53 } |
|
54 ] |
|
55 }; |
|
56 testAccessibleTree(aID, tree); |
|
57 } |
|
58 |
|
59 this.getID = function showARIADialog_getID() |
|
60 { |
|
61 return "show ARIA dialog"; |
|
62 } |
|
63 } |
|
64 |
|
65 //////////////////////////////////////////////////////////////////////////// |
|
66 // Test |
|
67 |
|
68 //gA11yEventDumpID = "eventdump"; // debug stuff |
|
69 //gA11yEventDumpToConsole = true; |
|
70 |
|
71 var gQueue = null; |
|
72 |
|
73 function doTest() |
|
74 { |
|
75 gQueue = new eventQueue(); |
|
76 |
|
77 // make the accessible an inaccessible |
|
78 gQueue.push(new showARIADialog("dialog")); |
|
79 |
|
80 gQueue.invoke(); // SimpleTest.finish() will be called in the end |
|
81 } |
|
82 |
|
83 SimpleTest.waitForExplicitFinish(); |
|
84 addA11yLoadEvent(doTest); |
|
85 </script> |
|
86 </head> |
|
87 <body> |
|
88 |
|
89 <a target="_blank" |
|
90 title="Rework accessible tree update code" |
|
91 href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275"> |
|
92 Mozilla Bug 570275 |
|
93 </a> |
|
94 |
|
95 <p id="display"></p> |
|
96 <div id="content" style="display: none"></div> |
|
97 <pre id="test"> |
|
98 </pre> |
|
99 |
|
100 <div id="dialog" role="dialog" style="display: none;"> |
|
101 <table id="table" role="presentation" |
|
102 style="display: block; position: fixed; top: 88px; left: 312.5px; z-index: 10010; visibility: hidden;"> |
|
103 <tbody> |
|
104 <tr> |
|
105 <td role="presentation"> |
|
106 <div role="presentation"> |
|
107 <a id="a" role="button">text</a> |
|
108 </div> |
|
109 <input id="input"> |
|
110 </td> |
|
111 </tr> |
|
112 </tbody> |
|
113 </table> |
|
114 </div> |
|
115 |
|
116 <div id="eventdump"></div> |
|
117 </body> |
|
118 </html> |