Chromium Code Reviews| OLD | NEW |
|---|---|
| (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> | |
| OLD | NEW |