Source/WebCore:
Added ARIA 1.1 "cell" and "table" roles.
https://bugs.webkit.org/show_bug.cgi?id=146011
<rdar://problem/21398946>
Patch by Nan Wang <n_wang@apple.com> on 2015-07-10
Reviewed by Chris Fleizach.
Created a new role called GridCellRole to match the gridcell role,
so the previous CellRole and TableRole will match to cell and table role.
Made the changes to make sure that both GridRole and TableRole have same
behavior, as well as the circumstance for GridCellRole and CellRole.
Test: accessibility/roles-table-and-cell.html
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedRows):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::roleValue):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::determineAccessibilityRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
LayoutTests:
Added tests for new role: table and cell.
https://bugs.webkit.org/show_bug.cgi?id=146011.
Patch by Nan Wang <n_wang@apple.com> on 2015-07-10
Reviewed by Chris Fleizach.
Added tests for table and cell role. Also modified other tests to fit the changes.
* accessibility/roles-computedRoleString-expected.txt:
* accessibility/roles-computedRoleString.html:
* accessibilit/roles-table-and-cell-expected.txt: Added.
* accessibility/roles-table-and-cell.html: Added.
* platform/mac/accessibility/aria-table-hierarchy-expected.txt:
* platform/mac/accessibility/aria-tables-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@186692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/accessibility/roles-computedRoleString.html b/LayoutTests/accessibility/roles-computedRoleString.html
index 246089f..5b90b1f 100644
--- a/LayoutTests/accessibility/roles-computedRoleString.html
+++ b/LayoutTests/accessibility/roles-computedRoleString.html
@@ -97,7 +97,7 @@
<sup data-role="" class="ex">X</sup>
<svg data-role="" class="ex">X</svg>
-<table data-role="grid" class="ex">
+<table data-role="table" class="ex">
<caption data-role="" class="ex">X</caption>
<thead data-role="rowgroup" class="ex">
<tr data-role="row" class="ex">
@@ -106,15 +106,35 @@
</thead>
<tbody data-role="rowgroup" class="ex">
<tr data-role="row" class="ex">
- <td data-role="gridcell" class="ex">X</td>
+ <td data-role="cell" class="ex">X</td>
</tr>
</tbody>
<tfoot data-role="rowgroup" class="ex">
<tr data-role="row" class="ex">
- <td data-role="gridcell" class="ex">X</td>
+ <td data-role="cell" class="ex">X</td>
</tr>
</tfoot>
</table>
+
+<table role="grid" data-role="grid" class="ex">
+ <caption data-role="" class="ex">X</caption>
+ <thead data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <th data-role="columnheader" class="ex">X</th>
+ </tr>
+ </thead>
+ <tbody data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <td role="gridcell" data-role="gridcell" class="ex">X</td>
+ </tr>
+ </tbody>
+ <tfoot data-role="rowgroup" class="ex">
+ <tr data-role="row" class="ex">
+ <td role="gridcell" data-role="gridcell" class="ex">X</td>
+ </tr>
+ </tfoot>
+</table>
+
<textarea data-role="textbox" class="ex">X</textarea>
<time data-role="" class="ex">X</time>
<ul data-role="list" class="ex">