haikuwebkit/LayoutTests/accessibility/aria-cellspans-with-native-...

59 lines
1.9 KiB
HTML
Raw Permalink Normal View History

AX: aria-rowspan value should be ignored if td/th rowspan value is provided https://bugs.webkit.org/show_bug.cgi?id=171214 Reviewed by Chris Fleizach. Source/WebCore: Return -1 in AccessibilityTableCell::ariaColumnSpan() and ariaRowSpan() if the cell element has an explicit value for the native host language's span attribute. Add checks to AccessibilityTableCell::columnIndexRange() and rowIndexRange() so that we prefer an author-provided ARIA span value over an implicit host-language span value. Similarly, add checks to AccessibilityARIAGridCell::columnIndexRange() and rowIndexRange() so that we fall back on implicit host-language span values when there is no author-provided ARIA span value and the ARIA cell is associated with a cell element. Test: accessibility/aria-cellspans-with-native-cellspans.html * accessibility/AccessibilityARIAGridCell.cpp: (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex): (WebCore::AccessibilityARIAGridCell::columnIndexRange): * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::rowIndexRange): (WebCore::AccessibilityTableCell::columnIndexRange): (WebCore::AccessibilityTableCell::ariaColumnSpan): (WebCore::AccessibilityTableCell::ariaRowSpan): LayoutTests: * accessibility/aria-cellspans-with-native-cellspans-expected.txt: Added. * accessibility/aria-cellspans-with-native-cellspans.html: Added. Canonical link: https://commits.webkit.org/188550@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-04 01:40:45 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="content">
<table border="1">
<tr>
<th id="columnheader1" role="columnheader" rowspan="3" colspan="2" aria-rowspan="10" aria-colspan="10">header 1</th>
<th id="columnheader2" role="columnheader" aria-rowspan="10" aria-colspan="10">header 2</th>
<th id="columnheader3" role="columnheader" colspan="3" aria-rowspan="10" aria-colspan="10">header 3</th>
</tr>
<tr>
<td id="cell1" rowspan="2" colspan="2" aria-rowspan="10" aria-colspan="10">cell 1</td>
<td id="cell2" aria-rowspan="10" aria-colspan="10">cell 2</td>
<td id="cell3" rowspan="3" aria-rowspan="10" aria-colspan="10">cell 3</td>
</tr>
<tr>
<td>cell 4</td>
</tr>
<tr>
<td>cell 5</td>
<td>cell 6</td>
<td>cell 7</td>
<td>cell 8</td>
<td>cell 9</td>
</tr>
</table>
</div>
<script>
description("This verifies that ARIA cell spans are ignored when native cell spans are set.");
function span(rangeString) {
return rangeString.split(/\D/).filter(function(x){ return x != ""; })[1];
}
function outputSpans(id) {
var axElement = accessibilityController.accessibleElementById(id);
var rowSpan = span(axElement.rowIndexRange());
var columnSpan = span(axElement.columnIndexRange());
debug(id + " spans " + rowSpan + " row(s) and " + columnSpan + " column(s).");
}
if (window.accessibilityController) {
ids = ["columnheader1", "columnheader2", "columnheader3", "cell1", "cell2", "cell3"];
idCount = ids.length;
for (var i = 0; i < idCount; i++)
outputSpans(ids[i]);
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>