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

Unified Diff: third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html

Issue 1917943002: Accessible name calc should allow aria-labelledby to reference aria-hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html b/third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html
new file mode 100644
index 0000000000000000000000000000000000000000..56c2add09ee46d415875aec38ea757cee522a861
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/accessibility/name-calc-aria-hidden.html
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<style>
+.hideAllContainers .container {
+ display: none;
+}
+</style>
+
+<div class="container">
+ <h3 id="heading1">
+ Before
+ <p id="hidden1" aria-hidden="true">Hidden text</p>
+ After
+ </h3>
+ <button id="button1" aria-labelledby="hidden1"></button>
+</div>
+
+<script>
+test(function(t) {
+ var axHeading1 = accessibilityController.accessibleElementById("heading1");
+ assert_equals(axHeading1.name, "Before After");
+ var axButton1 = accessibilityController.accessibleElementById("button1");
+ assert_equals(axButton1.name, "Hidden text");
+}, "Aria-labelledby can get accessible text from aria-hidden subtree");
aboxhall 2016/04/25 18:21:25 For completeness, could we have a test where aria-
dmazzoni 2016/04/25 22:33:03 Sure, done. See below:
+</script>
+
+<div class="container">
+ <h3 id="heading2">
+ Before
+ <p id="hidden2" aria-hidden="true">Hidden text</p>
+ After
+ </h3>
+ <button id="button2" aria-labelledby="heading2"></button>
+</div>
+
+<script>
+test(function(t) {
+ var axHeading2 = accessibilityController.accessibleElementById("heading2");
+ assert_equals(axHeading2.name, "Before After");
+ var axButton2 = accessibilityController.accessibleElementById("button2");
+ assert_equals(axButton2.name, "Before After");
+}, "Aria-labelledby ignores accessible text that's aria-hidden inside subtree");
+</script>
+
+<script>
+if (window.testRunner)
+ document.body.className = "hideAllContainers";
+</script>

Powered by Google App Engine
This is Rietveld 408576698