blob: 840bf04597f94030590c62090cff9b6d308adfae [file] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/accessibility-helper.js"></script>
<script src="../resources/js-test.js"></script>
</head>
<body id="body" role="group">
<ul id="ul">
<li id="li1">One</li>
<li>Two</li>
<li>Three</li>
</ul>
<script>
var output = "This test ensures that we don't crash when removing an object from the AX tree whose child recently changed aria-hidden status.\n\n";
function dumpAccessibilityChildren(element, level) {
let indent = "";
for (let k = 0; k < level; k++) { indent += " "; }
output += `${indent}${element.role} ${element.title} ${element.description}\n`;
for (let k = 0; k < element.childrenCount; k++)
dumpAccessibilityChildren(element.childAtIndex(k), level + 1)
return true;
}
if (window.accessibilityController) {
window.jsTestIsAsync = true;
dumpAccessibilityChildren(accessibilityController.accessibleElementById("body"), 0);
output += "\nMaking #li1 aria-hidden and #ul display:none.\n";
document.getElementById("li1").setAttribute("aria-hidden", "true");
document.getElementById("ul").style.display = "none"
setTimeout(async function() {
await waitFor(() => !accessibilityController.accessibleElementById("ul"));
output += "\nRe-dumping AX tree.\n\n";
dumpAccessibilityChildren(accessibilityController.accessibleElementById("body"), 0);
output += "\nPASS: There was no crash.\n";
debug(output);
finishJSTest();
}, 0);
}
</script>
</body>
</html>