haikuwebkit/LayoutTests/accessibility/aria-combobox-hierarchy.html

31 lines
1010 B
HTML
Raw Permalink Normal View History

AX: [ATK] Implement selection interface and states for elements supporting aria-selected and for menu roles https://bugs.webkit.org/show_bug.cgi?id=164865 Reviewed by Chris Fleizach. Source/WebCore: Implement AtkSelection and support ATK_STATE_SELECTABLE and ATK_STATE_SELECTED for elements supporting aria-selected and for menu-related roles. Also enable the equivalent support for the Mac because NSAccessibilitySelectedChildrenAttribute is included as supported on the same roles. In addition, fix several bugs discovered along the way: Call isSelected() on role tab, because tab supports aria-selected; not aria-checked. Correct ATK mapping of ListBoxRole and ListBoxOptionRole for combobox descendants. Always defer to WebCore for inclusion/exclusion decisions related to elements with an explicit ARIA role. Tests: accessibility/aria-combobox-hierarchy.html accessibility/aria-selected-menu-items.html accessibility/aria-selected.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::selectedTabItem): (WebCore::AccessibilityNodeObject::canSetSelectedAttribute): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isDescendantOfRole): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::canHaveSelectedChildren): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::isSelected): (WebCore::AccessibilityRenderObject::canHaveSelectedChildren): (WebCore::AccessibilityRenderObject::selectedChildren): * accessibility/AccessibilityRenderObject.h: * accessibility/atk/AccessibilityObjectAtk.cpp: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp: (webkitAccessibleSelectionGetSelectionCount): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkRole): (getInterfaceMaskFromObject): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): LayoutTests: New tests for the added support. In addition, update the expectations for aria-combobox.html to reflect the corrected ATK mapping of ListBoxRole for combobox descendants. * accessibility/aria-combobox-expected.txt: Updated. * accessibility/aria-combobox-hierarchy.html: Added. * accessibility/aria-selected-menu-items.html: Added. * accessibility/aria-selected.html: Added. * platform/gtk/accessibility/aria-combobox-hierarchy-expected.txt: Added. * platform/gtk/accessibility/aria-selected-expected.txt: Added. * platform/gtk/accessibility/aria-selected-menu-items-expected.txt: Added. * platform/mac/accessibility/aria-combobox-hierarchy-expected.txt: Added. * platform/mac/accessibility/aria-selected-expected.txt: Added. * platform/mac/accessibility/aria-selected-menu-items-expected.txt: Added. Canonical link: https://commits.webkit.org/182638@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-19 21:12:24 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body id="body">
<div id="content">
<div id="combobox" tabindex="0" role="combobox" aria-expanded="True">
<div role="listbox">
<div role="option">option 1</div>
<div role="option">option 2</div>
</div>
</div>
</div>
<p id="description"></p>
<pre id="tree"></pre>
<div id="console"></div>
<script>
description("This verifies the accessibility tree of ARIA comboboxes.");
if (window.accessibilityController) {
var axCombobox = accessibilityController.accessibleElementById("combobox");
var stopElement = accessibilityController.accessibleElementById("stopElement");
dumpAccessibilityTree(axCombobox, stopElement, 0);
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>