|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 |
|
3 <head> |
|
4 <title>Accessible mutation events testing</title> |
|
5 |
|
6 <link rel="stylesheet" type="text/css" |
|
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <bindings xmlns="http://www.mozilla.org/xbl" > |
|
10 <binding id="button"> |
|
11 <content> |
|
12 <button xmlns="http://www.w3.org/1999/xhtml">a button</button> |
|
13 </content> |
|
14 </binding> |
|
15 </bindings> |
|
16 |
|
17 <script type="application/javascript" |
|
18 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
19 <script type="application/javascript" |
|
20 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
21 |
|
22 <script type="application/javascript" |
|
23 src="../common.js"></script> |
|
24 <script type="application/javascript" |
|
25 src="../events.js"></script> |
|
26 |
|
27 <script type="application/javascript"> |
|
28 |
|
29 /** |
|
30 * Insert a not accessible bound element containing an accessible element |
|
31 * in anonymous content. |
|
32 */ |
|
33 function insertBinding(aContainerID) |
|
34 { |
|
35 this.containerNode = getNode(aContainerID); |
|
36 |
|
37 function getButtonFromBinding(aNode) |
|
38 { |
|
39 try { return document.getAnonymousNodes(aNode.firstChild)[0]; } |
|
40 catch (e) { return null; } |
|
41 } |
|
42 |
|
43 this.eventSeq = [ |
|
44 new invokerChecker(EVENT_SHOW, getButtonFromBinding, this.containerNode), |
|
45 new invokerChecker(EVENT_REORDER, this.containerNode) |
|
46 ]; |
|
47 |
|
48 this.invoke = function insertBinding_invoke() |
|
49 { |
|
50 var span = document.createElement("span"); |
|
51 span.setAttribute("style", "-moz-binding:url(#button)"); |
|
52 this.containerNode.appendChild(span); |
|
53 } |
|
54 |
|
55 this.getID = function insertBinding_getID() |
|
56 { |
|
57 return "insert button binding"; |
|
58 } |
|
59 } |
|
60 |
|
61 /** |
|
62 * Do tests. |
|
63 */ |
|
64 var gQueue = null; |
|
65 //gA11yEventDumpID = "eventdump"; // debug stuff |
|
66 //gA11yEventDumpToConsole = true; |
|
67 |
|
68 function doTests() |
|
69 { |
|
70 gQueue = new eventQueue(); |
|
71 |
|
72 gQueue.push(new insertBinding("testContainer")); |
|
73 |
|
74 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
75 } |
|
76 |
|
77 SimpleTest.waitForExplicitFinish(); |
|
78 addA11yLoadEvent(doTests); |
|
79 </script> |
|
80 </head> |
|
81 |
|
82 <body> |
|
83 |
|
84 <a target="_blank" |
|
85 href="https://bugzilla.mozilla.org/show_bug.cgi?id=646369" |
|
86 title="UpdateTree should rely on accessible tree walker rather than DOM tree traversal"> |
|
87 Mozilla Bug 646369</a> |
|
88 |
|
89 <p id="display"></p> |
|
90 <div id="content" style="display: none"></div> |
|
91 <pre id="test"> |
|
92 </pre> |
|
93 <div id="eventdump"></div> |
|
94 |
|
95 <div id="testContainer"></div> |
|
96 </body> |
|
97 </html> |