1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
<!DOCTYPE html>
<html>
<head>
<title>Test accessible delayed removal</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../promisified-events.js"></script>
<script type="application/javascript">
async function testInnerReorder() {
window.windowUtils.advanceTimeAndRefresh(100);
let events = waitForOrderedEvents([
[EVENT_HIDE, "c1.1.1"],
[EVENT_SHOW, "c1.1.1"],
[EVENT_INNER_REORDER, "c1.1"],
[EVENT_REORDER, "c1"],
], "events yay");
let child = getNode("c1.1.1");
child.remove();
getNode("c1").appendChild(child);
window.windowUtils.restoreNormalRefresh();
await events;
}
async function testInnerReorderEntry() {
window.windowUtils.advanceTimeAndRefresh(100);
let events = waitForOrderedEvents([
[EVENT_HIDE, e => e.accessible.name == "hello"],
[EVENT_HIDE, "c2.2"],
[EVENT_INNER_REORDER, "c2.1"],
[EVENT_REORDER, "c2"],
[EVENT_TEXT_VALUE_CHANGE, "c2.1"],
], "events yay");
getNode("c2.1.1").remove();
getNode("c2.2").remove();
window.windowUtils.restoreNormalRefresh();
await events;
}
async function testInnerReorderAriaOwns() {
let events = waitForOrderedEvents([
[EVENT_HIDE, "c3.1.1"],
[EVENT_SHOW, "c3.1.1"],
[EVENT_INNER_REORDER, "c3.1"],
[EVENT_REORDER, "c3"],
], "events yay");
getNode("c3").setAttribute("aria-owns", "c3.1.1");
await events;
events = waitForOrderedEvents([
[EVENT_HIDE, "c3.1.1"],
[EVENT_SHOW, "c3.1.1"],
[EVENT_INNER_REORDER, "c3.1"],
[EVENT_REORDER, "c3"],
], "events yay");
getNode("c3").removeAttribute("aria-owns");
await events;
}
async function testInnerContainerRemoved() {
window.windowUtils.advanceTimeAndRefresh(100);
let events = waitForOrderedEvents([
[EVENT_HIDE, "c4.1"],
[EVENT_SHOW, "c4.1.1"],
[EVENT_REORDER, "c4"],
], "events yay");
let child = getNode("c4.1.1");
child.remove();
getNode("c1").appendChild(child);
getNode("c4.1").remove();
window.windowUtils.restoreNormalRefresh();
await events;
}
async function doTest() {
await testInnerReorder();
await testInnerReorderEntry();
await testInnerReorderAriaOwns();
await testInnerContainerRemoved();
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="c1">
<div id="c1.1"><div id="c1.1.1">hello</div></div>
</div>
<div id="c2">
<div role="textbox" contenteditable="true" id="c2.1">
<span id="c2.1.1">hello</span>
</div>
<input type="submit" id="c2.2">
</div>
<div id="c3">
<div id="c3.1"><div id="c3.1.1"></div></div>
</div>
<div id="c4">
<div id="c4.1"><div id="c4.1.1">hello</div></div>
</div>
<div id="eventdump"></div>
</body>
</html>
|