blob: 549c5f4a4c23cacd75860a2b39e7f367074038df [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="bg">
<p id="bgContent">Other page content with <a href="#">a dummy focusable element</a></p>
</div>
<div id="container">
<div role="dialog" aria-modal="false" id="box">
<h3 id="myDialog">Just an example.</h3>
</div>
</div>
<script>
description("This tests that when something is aria-modal inside an aria-hidden it is ignored.");
window.jsTestIsAsync = true;
async function test() {
if (window.accessibilityController) {
shouldBeFalse("accessibilityController.accessibleElementById('bgContent').isIgnored");
await new Promise(requestAnimationFrame);
document.getElementById("box").setAttribute("aria-modal", "true");
await new Promise(requestAnimationFrame);
backgroundContent = accessibilityController.accessibleElementById('bgContent');
shouldBeTrue("!backgroundContent || backgroundContent.isIgnored");
await new Promise(requestAnimationFrame);
document.getElementById("container").setAttribute("aria-hidden", "true");
await new Promise(requestAnimationFrame);
shouldBeFalse("accessibilityController.accessibleElementById('bgContent').isIgnored");
finishJSTest();
}
}
test();
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>