[ATK] Implement support for DPub ARIA roles
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Apr 2017 08:48:53 +0000 (08:48 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Apr 2017 08:48:53 +0000 (08:48 +0000)
commit661b2f3b3c4456a9bd866241ae4a5ba8d6af641c
tree1a551ade495920d265a5ab6cd5a28112ed6773f4
parent0d2d45f931aacf9224b906455ebfa6d47683a7ff
[ATK] Implement support for DPub ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=170679

Reviewed by Chris Fleizach.

Source/WebCore:

Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup.
These roles make it possible for platforms to distinguish groups which are primarily
intended to display textual content from groups which are primarily intended to hold
user-interface objects. Use these roles to fix the ATK mapping of DPub's groups, which
should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL.

Modify the following WebCore AccessibilityRole mappings:
- doc-abstract changed to ApplicationTextGroupRole because this DPub ARIA role does
  not subclass the ARIA landmark role
- doc-biblioentry and doc-endnote changed to ListItemRole, because these DPub ARIA
  roles subclass the ARIA listitem role
- doc-notice and doc-tip changed to DocumentNoteRole because these DPub ARIA roles
  subclass the ARIA note role
- doc-pagebreak changed to SplitterRole because this DPub ARIA role subclasses the
  ARIA separator role

No new tests required: New test cases were added to xml-roles-exposed.html, and
the platform expectations for roles-exposed.html were updated to reflect the
correct mappings.

* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::determineAccessibilityRole):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isGroup):
(WebCore::AccessibilityNodeObject::helpText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaTreeItemContent):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::helpText):
(WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):
(roleIsTextType):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):

Tools:

Add DPub ARIA landmark roles to roleToString().

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

LayoutTests:

Update tests and expectations to reflect the modified WebCore Accessibility
role mappings, and the corresponding changes for the platforms.

* accessibility/gtk/xml-roles-exposed-expected.txt:
* accessibility/gtk/xml-roles-exposed.html:
* accessibility/roles-exposed.html:
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt
LayoutTests/accessibility/gtk/xml-roles-exposed.html
LayoutTests/accessibility/roles-exposed.html
LayoutTests/inspector/dom/getAccessibilityPropertiesForNode-expected.txt
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityList.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp