Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html |
| diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html b/third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..04c249382aa6486175c3042f5566febd8c7bc1d1 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/accessibility/aria-relations-should-ignore-hidden-targets.html |
| @@ -0,0 +1,57 @@ |
| +<!DOCTYPE html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| + |
| +<style> |
| +.hideAllContainers .container { display: none; } |
| +</style> |
| + |
| +<div class="container"> |
| + <ul id="tablist" role="tablist"> |
| + <li id="tab" role="tab" aria-controls="panel"></li> |
| + </ul> |
| + <div id="panel" role="tabpanel">Panel</div> |
| +</div> |
| + |
| +<div class="container"> |
|
aboxhall
2016/07/08 17:12:35
Suggestion: put this in between the first and seco
|
| + <h1 id="headingWithFlowtos" aria-flowto="item1 item2">Heading</h1> |
| + <ul id="flowtoItems"> |
| + <li id="item1">One</li> |
| + <li id="item2">Two</li> |
| + </ul> |
| +</div> |
| + |
| +<script> |
| +test(function(t) |
| +{ |
| + var axTab = accessibilityController.accessibleElementById('tab'); |
| + var panel = document.getElementById('panel'); |
| + var axPanel = accessibilityController.accessibleElementById('panel'); |
| + assert_equals(axTab.ariaControlsElementAtIndex(0), axPanel); |
| + panel.style.display = 'none'; |
|
aboxhall
2016/07/08 17:12:35
Test for visibility: hidden as well? Here and belo
|
| + assert_not_equals(axTab.ariaControlsElementAtIndex(0), axPanel); |
| +}, 'aria-controls should ignore hidden targets.'); |
| + |
| +test(function(t) |
| +{ |
| + var axHeading = accessibilityController.accessibleElementById('headingWithFlowtos'); |
| + var flowtoItems = document.getElementById('flowtoItems'); |
| + var item1 = document.getElementById('item1'); |
| + var axItem1 = accessibilityController.accessibleElementById('item1'); |
| + var item2 = document.getElementById('item2'); |
| + var axItem2 = accessibilityController.accessibleElementById('item2'); |
| + |
| + assert_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1); |
| + assert_equals(axHeading.ariaFlowToElementAtIndex(1), axItem2); |
| + |
| + item2.style.display = 'none'; |
| + assert_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1); |
| + assert_not_equals(axHeading.ariaFlowToElementAtIndex(1), axItem2); |
| + |
| + flowtoItems.style.display = 'none'; |
| + assert_not_equals(axHeading.ariaFlowToElementAtIndex(0), axItem1); |
| +}, 'aria-flowto should ignore hidden targets.'); |
| + |
| +if (window.testRunner) |
| + document.body.className = "hideAllContainers"; |
| +</script> |