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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html

Issue 2112243004: Ignores ARIA relations (e.g. aria-labelledby) that point to an invisible target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed invisible to hidden to match ARIA Implementation Guide. Created 4 years, 5 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
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 { display: none; }
7 </style>
8
9 <div class="container">
10 <ul id="tablist" role="tablist">
11 <li id="tab" role="tab" aria-controls="panel"></li>
12 </ul>
13 <div id="panel" role="tabpanel">Panel</div>
14 </div>
15
16 <div class="container">
aboxhall 2016/07/08 17:12:35 Suggestion: put this in between the first and seco
17 <h1 id="headingWithFlowtos" aria-flowto="item1 item2">Heading</h1>
18 <ul id="flowtoItems">
19 <li id="item1">One</li>
20 <li id="item2">Two</li>
21 </ul>
22 </div>
23
24 <script>
25 test(function(t)
26 {
27 var axTab = accessibilityController.accessibleElementById('tab');
28 var panel = document.getElementById('panel');
29 var axPanel = accessibilityController.accessibleElementById('panel');
30 assert_equals(axTab.ariaControlsElementAtIndex(0), axPanel);
31 panel.style.display = 'none';
aboxhall 2016/07/08 17:12:35 Test for visibility: hidden as well? Here and belo
32 assert_not_equals(axTab.ariaControlsElementAtIndex(0), axPanel);
33 }, 'aria-controls should ignore hidden targets.');
34
35 test(function(t)
36 {
37 var axHeading = accessibilityController.accessibleElementById('headingWithFl owtos');
38 var flowtoItems = document.getElementById('flowtoItems');
39 var item1 = document.getElementById('item1');
40 var axItem1 = accessibilityController.accessibleElementById('item1');
41 var item2 = document.getElementById('item2');
42 var axItem2 = accessibilityController.accessibleElementById('item2');
43
44 assert_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1);
45 assert_equals(axHeading.ariaFlowToElementAtIndex(1), axItem2);
46
47 item2.style.display = 'none';
48 assert_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1);
49 assert_not_equals(axHeading.ariaFlowToElementAtIndex(1), axItem2);
50
51 flowtoItems.style.display = 'none';
52 assert_not_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1);
53 }, 'aria-flowto should ignore hidden targets.');
54
55 if (window.testRunner)
56 document.body.className = "hideAllContainers";
57 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698