Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE html>
<html>
<head>
<title>Stale state testing</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="../states.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
async function doTest() {
const containerNode = getNode("container");
let childNode = null;
let reordered = waitForEvent(EVENT_REORDER, containerNode);
childNode = document.createElement("div");
// and would not result in an embedded character.
// Therefore, add some text.
childNode.textContent = "hello";
containerNode.appendChild(childNode);
await reordered;
// no stale state should be set
testStates(childNode, 0, 0, 0, EXT_STATE_STALE);
const child = getAccessible(containerNode.firstChild);
const hidden = waitForEvent(EVENT_HIDE, e => {
if (e.accessible != child) {
return false;
}
// stale state should be set
testStates(child, 0, EXT_STATE_STALE);
return true;
});
containerNode.firstChild.remove();
await hidden;
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body role="">
<a target="_blank"
title="Expose stale state on accessibles unattached from tree"
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="container"></div>
</body>
</html>