[ATK] ARIA treegrid role should be exposed as ATK_ROLE_TREE_TABLE; not ATK_ROLE_TABLE
https://bugs.webkit.org/show_bug.cgi?id=171170

Reviewed by Chris Fleizach.

Source/WebCore:

AccessibilityTable::roleValue() was returning GridRole for both grid and treegrid.
Change this so that GridRole is returned for grid and TreeGridRole is returned for
treegrid. Add TreeGridRole to, or call isTable() in, methods where the behavior
should be the same as GridRole.

Test: accessibility/gtk/interface-table.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::roleValue):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
(getInterfaceMaskFromObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):

Tools:

Add "AXInterfaceTable" attribute to test which elements implement AtkTable.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::boolAttributeValue):

LayoutTests:

Add interface-table.html to verify that all roles which have tabular functionality
implement AtkTable. Update other tests to reflect that the ARIA treegrid role maps
to our internal TreeGridRole AccessibilityRole.

* accessibility/gtk/interface-table-cell-expected.txt: Updated.
* accessibility/gtk/interface-table-expected.txt: Added.
* accessibility/gtk/interface-table.html: Added.
* accessibility/roles-computedRoleString.html: Updated.
* platform/gtk/accessibility/aria-selected-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.
* platform/mac/accessibility/roles-computedRoleString-expected.txt: Updated.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@215988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index 45a27df..e552e39 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -551,6 +551,8 @@
     case GridRole:
     case TableRole:
         return ATK_ROLE_TABLE;
+    case TreeGridRole:
+        return ATK_ROLE_TREE_TABLE;
     case ApplicationRole:
         return ATK_ROLE_APPLICATION;
     case ApplicationGroupRole:
@@ -1145,7 +1147,7 @@
         interfaceMask |= 1 << WAIImage;
 
     // Table
-    if (role == TableRole || role == GridRole)
+    if (coreObject->isTable())
         interfaceMask |= 1 << WAITable;
 
 #if ATK_CHECK_VERSION(2,11,90)