Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE html>
<html>
<head>
<title>Test accessible delayed removal</title>
<link rel="stylesheet" type="text/css"
<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>