accessible/tests/mochitest/events/test_aria_objattr.html

branch
TOR_BUG_9701
changeset 14
925c144e1f1f
equal deleted inserted replaced
-1:000000000000 0:f62093501013
1 <html>
2
3 <head>
4 <title>Accessible ARIA object attribute changes</title>
5
6 <link rel="stylesheet" type="text/css"
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
8
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
11
12 <script type="application/javascript"
13 src="../common.js"></script>
14 <script type="application/javascript"
15 src="../events.js"></script>
16
17 <script type="application/javascript">
18
19 /**
20 * Do tests.
21 */
22 var gQueue = null;
23
24 function updateAttribute(aID, aAttr, aValue)
25 {
26 this.node = getNode(aID);
27 this.accessible = getAccessible(this.node);
28
29 this.eventSeq = [
30 new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
31 ];
32
33 this.invoke = function updateAttribute_invoke()
34 {
35 this.node.setAttribute(aAttr, aValue);
36 }
37
38 this.getID = function updateAttribute_getID()
39 {
40 return aAttr + " for " + aID + " " + aValue;
41 }
42 }
43
44 // Debug stuff.
45 // gA11yEventDumpID = "eventdump";
46 //gA11yEventDumpToConsole = true;
47
48 function doTests()
49 {
50 gQueue = new eventQueue();
51
52 gQueue.push(new updateAttribute("hideable", "aria-hidden", "true"));
53
54 gQueue.push(new updateAttribute("sortable", "aria-sort", "ascending"));
55
56 // For experimental ARIA extensions
57 gQueue.push(new updateAttribute("custom", "aria-blah", "true"));
58
59 gQueue.invoke(); // Will call SimpleTest.finish();
60 }
61
62 SimpleTest.waitForExplicitFinish();
63 addA11yLoadEvent(doTests);
64 </script>
65 </head>
66
67 <body>
68
69 <a target="_blank"
70 href="https://bugzilla.mozilla.org/show_bug.cgi?id=581096"
71 title="Add support for aria-hidden">
72 Mozilla Bug 581096
73 </a>
74
75 <a target="_blank"
76 href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
77 title="Add event support for aria-sort">
78 Mozilla Bug 640707
79 </a>
80
81 <a target="_blank"
82 href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
83 title="Expand support for aria attribute change events">
84 Mozilla Bug 563862
85 </a>
86
87 <p id="display"></p>
88 <div id="content" style="display: none"></div>
89 <pre id="test">
90 </pre>
91 <div id="eventdump"></div>
92
93 <div id="hideable"><div>Hi</div><div>there</div></div>
94
95 <div id="sortable" role="columnheader" aria-sort="none">aria-sort</div>
96
97 <div id="custom" role="custom" aria-blah="false">Fat free cheese</div>
98 </body>
99 </html>

mercurial