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

Side by Side 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: Add more tests Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <style>
6 .hideAllContainers .container {
7 display: none;
8 }
9 </style>
10
11 <div class="container">
12 <h3 id="heading1">
13 Before
14 <p id="hidden1" aria-hidden="true">Hidden text</p>
15 After
16 </h3>
17 <button id="button1" aria-labelledby="hidden1"></button>
18 </div>
19
20 <script>
21 test(function(t) {
22 var axHeading1 = accessibilityController.accessibleElementById("heading1");
23 assert_equals(axHeading1.name, "Before After");
24 var axButton1 = accessibilityController.accessibleElementById("button1");
25 assert_equals(axButton1.name, "Hidden text");
26 }, "Aria-labelledby can get accessible text from aria-hidden subtree");
27 </script>
28
29 <div class="container">
30 <h3 id="heading2">
31 Before
32 <p id="hidden2" aria-hidden="true">Hidden text</p>
33 After
34 </h3>
35 <button id="button2" aria-labelledby="heading2"></button>
36 </div>
37
38 <script>
39 test(function(t) {
40 var axHeading2 = accessibilityController.accessibleElementById("heading2");
41 assert_equals(axHeading2.name, "Before After");
42 var axButton2 = accessibilityController.accessibleElementById("button2");
43 assert_equals(axButton2.name, "Before After");
44 }, "Aria-labelledby ignores accessible text that's aria-hidden inside subtree");
45 </script>
46
47 <div class="container">
48 <h3 id="heading3" aria-hidden="true">
49 Before
50 <p id="hidden3">Text within hidden subtree</p>
51 After
52 </h3>
53 <button id="button3" aria-labelledby="hidden3"></button>
54 </div>
55
56 <script>
57 test(function(t) {
58 var axHeading3 = accessibilityController.accessibleElementById("heading3");
59 assert_equals(axHeading3, undefined);
60 var axButton3 = accessibilityController.accessibleElementById("button3");
61 assert_equals(axButton3.name, "Text within hidden subtree");
62 }, "Aria-labelledby can get accessible text from within aria-hidden subtree");
63 </script>
64
65 <div class="container">
66 <h3 id="heading4" aria-hidden="true">
67 Before
68 <p id="hidden4" aria-hidden="true">Text within hidden subtree</p>
69 After
70 </h3>
71 <button id="button4" aria-labelledby="heading4"></button>
72 </div>
73
74 <script>
75 test(function(t) {
76 var axButton4 = accessibilityController.accessibleElementById("button4");
77 assert_equals(axButton4.name, "Before After");
78 }, "Aria-labelledby of aria-hidden subtree with another aria-hidden inside");
79 </script>
80
81 <div class="container">
82 <label for="input5" aria-hidden="true">
83 Before
84 <p aria-hidden="true">Hidden text</p>
85 After</label>
86 <input id="input5">
87 </div>
88
89 <script>
90 test(function(t) {
91 var axInput5 = accessibilityController.accessibleElementById("input5");
92 assert_equals(axInput5.name, "Before After");
93 }, "Label can get accessible text from aria-hidden subtree");
94 </script>
95
96 <script>
97 if (window.testRunner)
98 document.body.className = "hideAllContainers";
99 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698