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

52 lines
1.9 KiB
HTML
Raw Permalink Normal View History

AX: [ATK] Table captions and table rows are missing from the accessible hierarchy https://bugs.webkit.org/show_bug.cgi?id=139005 Reviewed by Chris Fleizach. Source/WebCore: Expose table captions and rows via ATK. Accomplishing the former is done by role mapping and inclusion of the object as a child of the table for ATK. Accomplishing the latter was mostly a matter of deleting all the ATK platform code that had been forcing rows to be ignored. Because captions are not being exposed on the Mac, they are now explicitly being ignored for that platform. Tests: accessibility/aria-table-hierarchy.html accessibility/table-hierarchy.html * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Added CaptionRole. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::addChildren): Include non-ignored captions as table children. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetNChildren): Removed special handling for tables. (webkitAccessibleRefChild): Removed special handling for tables. (webkitAccessibleGetIndexInParent): Removed special handling for table cells. (atkRole): Corrected broken mapping for RowRole. (getNChildrenForTable): Deleted. (getChildForTable): Deleted. (getIndexInParentForCellInRow): Deleted. * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject): Ignore captions as table children. Tools: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: Add mapping for ATK_ROLE_CAPTION to roleToString LayoutTests: * accessibility/aria-table-hierarchy.html: Added. * accessibility/roles-exposed.html: Removed comment pointing to this bug. * accessibility/table-hierarchy.html: Added. * platform/efl/accessibility/aria-table-hierarchy-expected.txt: Added. * platform/efl/accessibility/roles-exposed-expected.txt: Updated to reflect new behavior. * platform/efl/accessibility/table-detection-expected.txt: Updated to reflect new behavior. * platform/efl/accessibility/table-hierarchy-expected.txt: Added. * platform/efl/accessibility/table-roles-hierarchy-expected.txt: Added. * platform/efl/accessibility/table-with-rules-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/aria-table-hierarchy-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/aria-table-hierarchy.html: Removed (made into a shared test). * platform/gtk/accessibility/caret-offsets-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/caret-offsets.html: Modified to handle inclusion of rows. * platform/gtk/accessibility/roles-exposed-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/table-detection-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/table-hierarchy-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/table-hierarchy.html: Removed (made into a shared test). * platform/gtk/accessibility/table-roles-hierarchy-expected.txt: Added. * platform/gtk/accessibility/table-with-rules-expected.txt: Updated to reflect new behavior. * platform/gtk/accessibility/text-for-range-table-cells.html: Updated to reflect new behavior. * platform/mac/accessibility/aria-table-hierarchy-expected.txt: Added. * platform/mac/accessibility/table-hierarchy-expected.txt: Added. Canonical link: https://commits.webkit.org/157053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-03 02:02:36 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script>
function dumpAccessibilityChildren(element, level) {
if (element.stringValue.indexOf('End of test') >= 0)
return false;
var indent = "";
for (var k = 0; k < level; k++) { indent += " "; }
debug(indent + element.role + " " + element.stringValue);
var childrenCount = element.childrenCount;
for (var k = 0; k < childrenCount; k++) {
if (!dumpAccessibilityChildren(element.childAtIndex(k), level+1))
return false;
}
return true;
}
</script>
</head>
<body id="body">
<div role="grid">
<div role="row"><div role="gridcell">foo</div><div role="gridcell">bar</div></div>
</div>
<div role="grid">
<div role="row"><div role="columnheader">Odd</div><div role="columnheader">Even</div></div>
<div role="row"><div role="gridcell">1</div><div role="gridcell">2</div></div>
<div role="row"><div role="gridcell">3</div><div role="gridcell">4</div></div>
</div>
<div role="grid">
<div role="row"><div role="gridcell">hello</div><div role="gridcell">world</div></div>
</div>
<div role="grid">
<div role="row"><div role="columnheader">Odd</div><div role="columnheader">Even</div></div>
<div role="row"><div role="gridcell"><p>1</p></div><div role="gridcell"><p>2</p></div></div>
<div role="row"><div role="gridcell"><p>3</p></div><div role="gridcell"><p>4</p></div></div>
</div>
<div>End of test</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests the accessible hierarchy for an ARIA table.");
if (window.accessibilityController) {
document.getElementById("body").focus();
dumpAccessibilityChildren(accessibilityController.focusedElement, 0);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>