Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: LayoutTests/accessibility/inert-node-is-hidden.html

Issue 51743003: Treat inert nodes as aria-hidden instead of aria-disabled. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/accessibility/inert-node-is-hidden.html
diff --git a/LayoutTests/accessibility/inert-node-is-hidden.html b/LayoutTests/accessibility/inert-node-is-hidden.html
new file mode 100644
index 0000000000000000000000000000000000000000..90725265256cbdf82b211f879469cd34c14baa36
--- /dev/null
+++ b/LayoutTests/accessibility/inert-node-is-hidden.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+This content should not be exposed to AT when a modal dialog is open.
+<div>
+<input title="input" id="input" type="text">
+</div>
+<dialog title="dialog" id="dialog">Howdy</dialog>
+
+<script>
+description("This tests that inert elements are not in the AT tree.");
+
+function treeContainsText(node, text) {
+ if (node.stringValue.indexOf(text) > 0)
+ return true;
+ for (i = 0; i < node.childrenCount; i++) {
+ if (treeContainsText(node.childAtIndex(i), text))
+ return true;
+ }
+ return false;
+}
+
+if (window.accessibilityController) {
+ document.body.focus();
+ webArea = accessibilityController.focusedElement;
+
+ shouldBeNonNull("accessibilityController.accessibleElementById('input')");
+ shouldBeTrue("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')");
+
+ document.querySelector('dialog').showModal();
+ shouldBeNull("accessibilityController.accessibleElementById('input')");
+ shouldBeFalse("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')");
+
+ document.querySelector('dialog').close();
+ shouldBeNonNull("accessibilityController.accessibleElementById('input')");
+ shouldBeTrue("treeContainsText(webArea, 'This content should not be exposed to AT when a modal dialog is open')");
+}
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698