+2015-10-09 Nan Wang <n_wang@apple.com>
+
+ AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
+ https://bugs.webkit.org/show_bug.cgi?id=148967
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/mac/aria-columnrowheaders-expected.txt:
+ * accessibility/mac/aria-table-attributes-expected.txt: Added.
+ * accessibility/mac/aria-table-attributes.html: Added.
+ * platform/mac/accessibility/table-attributes-expected.txt:
+ * platform/mac/accessibility/table-cell-spans-expected.txt:
+ * platform/mac/accessibility/table-cells-expected.txt:
+ * platform/mac/accessibility/table-detection-expected.txt:
+ * platform/mac/accessibility/table-sections-expected.txt:
+ * platform/mac/accessibility/table-with-rules-expected.txt:
+
2015-10-09 Simon Fraser <simon.fraser@apple.com>
Garbage texture data with composited table row
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
--- /dev/null
+This tests that attributes related to aria table/grid are working correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS grid.numberAttributeValue('AXARIAColumnCount') is 16
+PASS grid.numberAttributeValue('AXARIARowCount') is 30
+PASS cell1.numberAttributeValue('AXARIAColumnIndex') is 2
+PASS cell1.numberAttributeValue('AXARIARowIndex') is 7
+PASS cell2.numberAttributeValue('AXARIAColumnIndex') is 4
+PASS cell2.numberAttributeValue('AXARIARowIndex') is 8
+PASS cell4.numberAttributeValue('AXARIAColumnIndex') is 3
+PASS cell2.rowIndexRange() is '{1, 2}'
+PASS cell5.columnIndexRange() is '{2, 3}'
+PASS cell3.rowIndexRange() is '{1, 2}'
+PASS cell6.rowIndexRange() is '{0, 2}'
+PASS cell7.rowIndexRange() is '{0, 2}'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+First Name Last Name Company Address
+Fred Jackson Acme, Inc. 123 Broad St.
+Sara James
+Footer 1 Footer 2 Footer 3
+Name Company Address
+Cell Span Cell
+Cell
+January $100
+February
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div id="grid" role="grid" aria-colcount="16" aria-rowcount="30">
+ <div role="rowgroup">
+ <div role="row" aria-rowindex="7">
+ <span id="cell1" role="columnheader" aria-colindex="2">First Name</span>
+ <span role="columnheader" aria-colindex="3">Last Name</span>
+ <span role="columnheader" aria-colindex="4">Company</span>
+ <span role="columnheader" aria-colindex="5">Address</span>
+ </div>
+ </div>
+ <div role="rowgroup">
+ <div role="row" aria-rowindex="8">
+ <span role="gridcell" aria-colindex="2" aria-rowindex="8">Fred</span>
+ <span role="gridcell" aria-colindex="3" aria-rowindex="8">Jackson</span>
+ <span id="cell2" role="gridcell" aria-colindex="4" aria-rowindex="8" aria-rowspan="2">Acme, Inc.</span>
+ <span id="cell3" role="gridcell" aria-colindex="5" aria-rowindex="8" aria-rowspan="0">123 Broad St.</span>
+ </div>
+ <div role="row" aria-rowindex="9">
+ <span role="gridcell" aria-colindex="2">Sara</span>
+ <span role="gridcell" aria-colindex="3">James</span>
+ </div>
+ </div>
+ <div role="rowgroup">
+ <div role="row" aria-rowindex="15">
+ <span role="gridcell" aria-colindex="2">Footer 1</span>
+ <span role="gridcell" aria-colindex="3">Footer 2</span>
+ <span role="gridcell" aria-colindex="4" aria-colspan="2">Footer 3</span>
+ </div>
+ </div>
+</div>
+
+<div id="grid2" role="grid" aria-colcount="16">
+ <div role="rowgroup">
+ <div role="row" aria-colindex="2">
+ <span role="columnheader">Name</span>
+ <span id="cell4" role="columnheader">Company</span>
+ <span id="cell5" role="columnheader" aria-colspan="3">Address</span>
+ </div>
+ </div>
+</div>
+
+<div id="grid3" role="grid">
+ <div role="row">
+ <span role="gridcell">Cell</span>
+ <span id="cell6" role="gridcell" aria-rowspan="0">Span Cell</span>
+ </div>
+ <div role="row">
+ <span role="gridcell">Cell</span>
+ </div>
+</div>
+
+<table role="grid">
+ <tr>
+ <td>January</td>
+ <td id="cell7" rowspan="2" aria-rowspan="3">$100</td>
+ </tr>
+ <tr><td>February</td></tr>
+</table>
+
+<script>
+
+ description("This tests that attributes related to aria table/grid are working correctly.");
+
+ if (window.accessibilityController) {
+
+ var grid = accessibilityController.accessibleElementById("grid");
+ var cell1 = accessibilityController.accessibleElementById("cell1");
+ var cell2 = accessibilityController.accessibleElementById("cell2");
+ var cell3 = accessibilityController.accessibleElementById("cell3");
+ var cell4 = accessibilityController.accessibleElementById("cell4");
+ var cell5 = accessibilityController.accessibleElementById("cell5");
+ var cell6 = accessibilityController.accessibleElementById("cell6");
+ var cell7 = accessibilityController.accessibleElementById("cell7");
+
+ // aria-colcount and aria-rowcount
+ shouldBe("grid.numberAttributeValue('AXARIAColumnCount')", "16");
+ shouldBe("grid.numberAttributeValue('AXARIARowCount')", "30");
+
+ // aria-colindex and aria-rowindex
+ shouldBe("cell1.numberAttributeValue('AXARIAColumnIndex')", "2");
+ shouldBe("cell1.numberAttributeValue('AXARIARowIndex')", "7");
+ shouldBe("cell2.numberAttributeValue('AXARIAColumnIndex')", "4");
+ shouldBe("cell2.numberAttributeValue('AXARIARowIndex')", "8");
+ // aria-colindex from parent row
+ shouldBe("cell4.numberAttributeValue('AXARIAColumnIndex')", "3");
+
+ // aria-colspan and aria-rowspan
+ shouldBe("cell2.rowIndexRange()", "'{1, 2}'");
+ shouldBe("cell5.columnIndexRange()", "'{2, 3}'");
+ // aria-rowspan="0"
+ shouldBe("cell3.rowIndexRange()", "'{1, 2}'");
+ shouldBe("cell6.rowIndexRange()", "'{0, 2}'");
+ // use rowspan for native table
+ shouldBe("cell7.rowIndexRange()", "'{0, 2}'");
+ }
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {4, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {4, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {4, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 2}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {3, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 2
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 2
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 2
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 3
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 3
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 2
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 1
AXRowCount: 24
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 2
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 1>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {0, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {1, 1}
AXColumnHeaderUIElements: <array of size 1>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXColumnIndexRange: NSRange: {2, 1}
AXColumnHeaderUIElements: <array of size 0>
AXRowHeaderUIElements: <array of size 0>
+AXARIAColumnIndex: -1
+AXARIARowIndex: -1
AXElementBusy: 0
AXRequired: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
AXHeader: <AXTable>
AXColumnCount: 2
AXRowCount: 1
+AXARIAColumnCount: -1
+AXARIARowCount: -1
AXElementBusy: 0
+2015-10-09 Nan Wang <n_wang@apple.com>
+
+ AX: ARIA 1.1 implement aria-colcount, aria-colindex, aria-colspan, aria-rowcount, aria-rowindex and aria-rowspan
+ https://bugs.webkit.org/show_bug.cgi?id=148967
+
+ Reviewed by Chris Fleizach.
+
+ Added support for ARIA 1.1 table/grid related attributes. Created new attributes for mac, so
+ VoiceOver can pick up the information and speak accordingly.
+
+ Test: accessibility/mac/aria-table-attributes.html
+
+ * accessibility/AccessibilityARIAGridCell.cpp:
+ (WebCore::AccessibilityARIAGridCell::AccessibilityARIAGridCell):
+ (WebCore::AccessibilityARIAGridCell::rowIndexRange):
+ (WebCore::AccessibilityARIAGridCell::columnIndexRange):
+ (WebCore::AccessibilityARIAGridCell::parentRowGroup):
+ * accessibility/AccessibilityARIAGridCell.h:
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::initializeRoleMap):
+ * accessibility/AccessibilityObject.h:
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::title):
+ (WebCore::AccessibilityTable::ariaColumnCount):
+ (WebCore::AccessibilityTable::ariaRowCount):
+ * accessibility/AccessibilityTable.h:
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::AccessibilityTableCell):
+ (WebCore::AccessibilityTableCell::titleUIElement):
+ (WebCore::AccessibilityTableCell::ariaColumnIndex):
+ (WebCore::AccessibilityTableCell::ariaRowIndex):
+ (WebCore::AccessibilityTableCell::ariaColumnSpan):
+ (WebCore::AccessibilityTableCell::ariaRowSpan):
+ * accessibility/AccessibilityTableCell.h:
+ (WebCore::AccessibilityTableCell::setARIAColIndexFromRow):
+ * accessibility/AccessibilityTableRow.cpp:
+ (WebCore::AccessibilityTableRow::headerObject):
+ (WebCore::AccessibilityTableRow::addChildren):
+ (WebCore::AccessibilityTableRow::ariaColumnIndex):
+ (WebCore::AccessibilityTableRow::ariaRowIndex):
+ * accessibility/AccessibilityTableRow.h:
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+ * html/HTMLAttributeNames.in:
+
2015-10-09 Anders Carlsson <andersca@apple.com>
Remove hack that allowed plug-ins to always take over certain image formats
#include "AccessibilityObject.h"
#include "AccessibilityTable.h"
#include "AccessibilityTableRow.h"
+#include "HTMLNames.h"
namespace WebCore {
+using namespace HTMLNames;
+
AccessibilityARIAGridCell::AccessibilityARIAGridCell(RenderObject* renderer)
: AccessibilityTableCell(renderer)
{
}
}
- // as far as I can tell, grid cells cannot span rows
- rowRange.second = 1;
+ // ARIA 1.1, aria-rowspan attribute is intended for cells and gridcells which are not contained in a native table.
+ // So we should check for that attribute here.
+ rowRange.second = ariaRowSpanWithRowIndex(rowRange.first);
+}
+
+unsigned AccessibilityARIAGridCell::ariaRowSpanWithRowIndex(unsigned rowIndex) const
+{
+ unsigned rowSpan = AccessibilityTableCell::ariaRowSpan();
+ AccessibilityObject* parent = parentObjectUnignored();
+ if (!parent)
+ return 1;
+
+ // Setting the value to 0 indicates that the cell or gridcell is to span all the remaining rows in the row group.
+ if (!rowSpan) {
+ // rowSpan defaults to 1.
+ rowSpan = 1;
+ if (AccessibilityObject* parentRowGroup = this->parentRowGroup()) {
+ // If the row group is the parent table, we use total row count to calculate the span.
+ if (is<AccessibilityTable>(*parentRowGroup))
+ rowSpan = downcast<AccessibilityTable>(*parentRowGroup).rowCount() - rowIndex;
+ // Otherwise, we have to get the index for the current row within the parent row group.
+ else if (is<AccessibilityTableRow>(*parent)) {
+ const auto& siblings = parentRowGroup->children();
+ unsigned rowCount = siblings.size();
+ for (unsigned k = 0; k < rowCount; ++k) {
+ if (siblings[k].get() == parent) {
+ rowSpan = rowCount - k;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return rowSpan;
}
void AccessibilityARIAGridCell::columnIndexRange(std::pair<unsigned, unsigned>& columnRange) const
}
}
- // as far as I can tell, grid cells cannot span columns
- columnRange.second = 1;
+ // ARIA 1.1, aria-colspan attribute is intended for cells and gridcells which are not contained in a native table.
+ // So we should check for that attribute here.
+ columnRange.second = ariaColumnSpan();
+}
+
+AccessibilityObject* AccessibilityARIAGridCell::parentRowGroup() const
+{
+ for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
+ if (parent->hasTagName(theadTag) || parent->hasTagName(tbodyTag) || parent->hasTagName(tfootTag) || parent->roleValue() == RowGroupRole)
+ return parent;
+ }
+
+ // If there's no row group found, we use the parent table as the row group.
+ return parentTable();
}
} // namespace WebCore
explicit AccessibilityARIAGridCell(RenderObject*);
virtual AccessibilityTable* parentTable() const override;
+ AccessibilityObject* parentRowGroup() const;
+ unsigned ariaRowSpanWithRowIndex(unsigned index) const;
};
} // namespace WebCore
{ "radiogroup", RadioGroupRole },
{ "region", DocumentRegionRole },
{ "row", RowRole },
+ { "rowgroup", RowGroupRole },
{ "scrollbar", ScrollBarRole },
{ "search", LandmarkSearchRole },
{ "searchbox", SearchFieldRole },
RadioGroupRole,
RowHeaderRole,
RowRole,
+ RowGroupRole,
RubyBaseRole,
RubyBlockRole,
RubyInlineRole,
return title;
}
+int AccessibilityTable::ariaColumnCount() const
+{
+ const AtomicString& colCountValue = getAttribute(aria_colcountAttr);
+
+ int colCountInt = colCountValue.toInt();
+ // If only a portion of the columns is present in the DOM at a given moment, this attribute is needed to
+ // provide an explicit indication of the number of columns in the full table.
+ if (colCountInt > (int)m_columns.size())
+ return colCountInt;
+
+ return -1;
+}
+
+int AccessibilityTable::ariaRowCount() const
+{
+ const AtomicString& rowCountValue = getAttribute(aria_rowcountAttr);
+
+ int rowCountInt = rowCountValue.toInt();
+ // If only a portion of the rows is present in the DOM at a given moment, this attribute is needed to
+ // provide an explicit indication of the number of rows in the full table.
+ if (rowCountInt > (int)m_rows.size())
+ return rowCountInt;
+
+ return -1;
+}
+
} // namespace WebCore
// isExposableThroughAccessibility() is whether it is exposed as an AccessibilityTable to the platform.
bool isExposableThroughAccessibility() const;
+
+ int ariaColumnCount() const;
+ int ariaRowCount() const;
protected:
explicit AccessibilityTable(RenderObject*);
AccessibilityTableCell::AccessibilityTableCell(RenderObject* renderer)
: AccessibilityRenderObject(renderer)
+ , m_ariaColIndexFromRow(-1)
{
}
return axObjectCache()->getOrCreate(headerCell);
}
+int AccessibilityTableCell::ariaColumnIndex() const
+{
+ const AtomicString& colIndexValue = getAttribute(aria_colindexAttr);
+ if (colIndexValue.toInt() >= 1)
+ return colIndexValue.toInt();
+
+ // "ARIA 1.1: If the set of columns which is present in the DOM is contiguous, and if there are no cells which span more than one row
+ // or column in that set, then authors may place aria-colindex on each row, setting the value to the index of the first column of the set."
+ // Here, we let its parent row to set its index beforehand, so we don't have to go through the siblings to calculate the index.
+ AccessibilityTableRow* parentRow = this->parentRow();
+ if (parentRow && m_ariaColIndexFromRow != -1)
+ return m_ariaColIndexFromRow;
+
+ return -1;
+}
+
+int AccessibilityTableCell::ariaRowIndex() const
+{
+ // ARIA 1.1: Authors should place aria-rowindex on each row. Authors may also place
+ // aria-rowindex on all of the children or owned elements of each row.
+ const AtomicString& rowIndexValue = getAttribute(aria_rowindexAttr);
+ if (rowIndexValue.toInt() >= 1)
+ return rowIndexValue.toInt();
+
+ if (AccessibilityTableRow* parentRow = this->parentRow())
+ return parentRow->ariaRowIndex();
+
+ return -1;
+}
+
+unsigned AccessibilityTableCell::ariaColumnSpan() const
+{
+ const AtomicString& colSpanValue = getAttribute(aria_colspanAttr);
+ // ARIA 1.1: Authors must set the value of aria-colspan to an integer greater than or equal to 1.
+ if (colSpanValue.toInt() >= 1)
+ return colSpanValue.toInt();
+
+ return 1;
+}
+
+unsigned AccessibilityTableCell::ariaRowSpan() const
+{
+ const AtomicString& rowSpanValue = getAttribute(aria_rowspanAttr);
+
+ // ARIA 1.1: Authors must set the value of aria-rowspan to an integer greater than or equal to 0.
+ // Setting the value to 0 indicates that the cell or gridcell is to span all the remaining rows in the row group.
+ if (equalIgnoringCase(rowSpanValue, "0"))
+ return 0;
+ if (rowSpanValue.toInt() >= 1)
+ return rowSpanValue.toInt();
+
+ return 1;
+}
+
} // namespace WebCore
void columnHeaders(AccessibilityChildrenVector&);
void rowHeaders(AccessibilityChildrenVector&);
+
+ int ariaColumnIndex() const;
+ int ariaRowIndex() const;
+ unsigned ariaColumnSpan() const;
+ unsigned ariaRowSpan() const;
+ void setARIAColIndexFromRow(int index) { m_ariaColIndexFromRow = index; }
protected:
explicit AccessibilityTableCell(RenderObject*);
virtual AccessibilityRole determineAccessibilityRole() override final;
int m_rowIndex;
+ int m_ariaColIndexFromRow;
private:
// If a table cell is not exposed as a table cell, a TH element can serve as its title UI element.
return cell;
}
+void AccessibilityTableRow::addChildren()
+{
+ AccessibilityRenderObject::addChildren();
+
+ // "ARIA 1.1, If the set of columns which is present in the DOM is contiguous, and if there are no cells which span more than one row or
+ // column in that set, then authors may place aria-colindex on each row, setting the value to the index of the first column of the set."
+ // Update child cells' ariaColIndex if there's an aria-colindex value set for the row. So the cell doesn't have to go through the siblings
+ // to calculate the index.
+ int colIndex = ariaColumnIndex();
+ if (colIndex == -1)
+ return;
+
+ unsigned index = 0;
+ for (const auto& cell : children()) {
+ if (is<AccessibilityTableCell>(*cell))
+ downcast<AccessibilityTableCell>(*cell).setARIAColIndexFromRow(colIndex + index);
+ index++;
+ }
+}
+
+int AccessibilityTableRow::ariaColumnIndex() const
+{
+ const AtomicString& colIndexValue = getAttribute(aria_colindexAttr);
+ if (colIndexValue.toInt() >= 1)
+ return colIndexValue.toInt();
+
+ return -1;
+}
+
+int AccessibilityTableRow::ariaRowIndex() const
+{
+ const AtomicString& rowIndexValue = getAttribute(aria_rowindexAttr);
+ if (rowIndexValue.toInt() >= 1)
+ return rowIndexValue.toInt();
+
+ return -1;
+}
+
} // namespace WebCore
// in the row, but their col/row spans overlap into it
void appendChild(AccessibilityObject*);
+ virtual void addChildren() override;
+
+ int ariaColumnIndex() const;
+ int ariaRowIndex() const;
+
protected:
explicit AccessibilityTableRow(RenderObject*);
case VideoRole:
case WebAreaRole:
case WindowRole:
+ case RowGroupRole:
return false;
}
#define NSAccessibilityARIACurrentAttribute @"AXARIACurrent"
#endif
+// Table/grid attributes
+#ifndef NSAccessibilityARIAColumnIndexAttribute
+#define NSAccessibilityARIAColumnIndexAttribute @"AXARIAColumnIndex"
+#endif
+
+#ifndef NSAccessibilityARIARowIndexAttribute
+#define NSAccessibilityARIARowIndexAttribute @"AXARIARowIndex"
+#endif
+
+#ifndef NSAccessibilityARIAColumnCountAttribute
+#define NSAccessibilityARIAColumnCountAttribute @"AXARIAColumnCount"
+#endif
+
+#ifndef NSAccessibilityARIARowCountAttribute
+#define NSAccessibilityARIARowCountAttribute @"AXARIARowCount"
+#endif
+
// Search
#ifndef NSAccessibilityImmediateDescendantsOnly
#define NSAccessibilityImmediateDescendantsOnly @"AXImmediateDescendantsOnly"
[tempArray addObject:NSAccessibilityHeaderAttribute];
[tempArray addObject:NSAccessibilityColumnCountAttribute];
[tempArray addObject:NSAccessibilityRowCountAttribute];
+ [tempArray addObject:NSAccessibilityARIAColumnCountAttribute];
+ [tempArray addObject:NSAccessibilityARIARowCountAttribute];
tableAttrs = [[NSArray alloc] initWithArray:tempArray];
[tempArray release];
}
[tempArray addObject:NSAccessibilityColumnIndexRangeAttribute];
[tempArray addObject:NSAccessibilityColumnHeaderUIElementsAttribute];
[tempArray addObject:NSAccessibilityRowHeaderUIElementsAttribute];
+ [tempArray addObject:NSAccessibilityARIAColumnIndexAttribute];
+ [tempArray addObject:NSAccessibilityARIARowIndexAttribute];
tableCellAttrs = [[NSArray alloc] initWithArray:tempArray];
[tempArray release];
}
if ([attributeName isEqualToString:NSAccessibilityRowCountAttribute])
return @(table.rowCount());
+
+ if ([attributeName isEqualToString:NSAccessibilityARIAColumnCountAttribute])
+ return @(table.ariaColumnCount());
+
+ if ([attributeName isEqualToString:NSAccessibilityARIARowCountAttribute])
+ return @(table.ariaRowCount());
}
if (is<AccessibilityTableColumn>(*m_object)) {
cell.rowHeaders(rowHeaders);
return convertToNSArray(rowHeaders);
}
+ if ([attributeName isEqualToString:NSAccessibilityARIAColumnIndexAttribute])
+ return @(cell.ariaColumnIndex());
+
+ if ([attributeName isEqualToString:NSAccessibilityARIARowIndexAttribute])
+ return @(cell.ariaRowIndex());
}
if (m_object->isTree()) {
aria-atomic
aria-busy
aria-checked
+aria-colcount
+aria-colindex
+aria-colspan
aria-controls
aria-current
aria-describedby
aria-relevant
aria-required
aria-roledescription
+aria-rowcount
+aria-rowindex
+aria-rowspan
aria-selected
aria-setsize
aria-sort