Implement AXIsolatedTreeNode::roleDescription.
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2019 13:21:57 +0000 (13:21 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2019 13:21:57 +0000 (13:21 +0000)
commit778463ca6aafa65ad9f6ea3d79e6bc0a8620f778
treed5350ecf4ed1d4319175faf26c9820f0e1696060
parent174003df834f748d486e0183b3631d9044b847cd
Implement AXIsolatedTreeNode::roleDescription.
https://bugs.webkit.org/show_bug.cgi?id=203863
<rdar://problem/56934443>

Reviewed by Chris Fleizach.

No new tests needed, no new functionality.

AccessibilityObjectWrapper cannot call any of the AX.*Text functions to
retrieve localized role descriptions, because when running on the
secondary thread, those AtomStrings are not accessible. Moreover, some
of the special cases require access to DOM objects that are not
available in the secondary thread. Therefore, added
AXCoreObject::rolePlatformDescription that runs in the main thread to
initialize the corresponding attribute in AXIsolatedTreeNode.
rolePlatformString, createPlatformRoleMap, roleToPlatformString,
ariaLandmarkRoleDescription, are helper functions. The platform
functions allow to customize the behavior of roleDescription in each
platform. The platform overrides are implemented for mac. Other
platforms are pending.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rolePlatformString const):
(WebCore::AccessibilityObject::rolePlatformDescription const):
(WebCore::AccessibilityObject::ariaLandmarkRoleDescription const):
(WebCore::AccessibilityObject::roleDescription const):
(WebCore::Accessibility::createPlatformRoleMap):
(WebCore::Accessibility::roleToPlatformString):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::rolePlatformString const):
(WebCore::AccessibilityObject::rolePlatformDescription const):
(WebCore::Accessibility::createPlatformRoleMap):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase accessibilityObject]):
(-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): Implementation moved to AccessibilityObject.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper role]): Special cases moved to rolePlatformString.
(-[WebAccessibilityObjectWrapper roleDescription]):
(createAccessibilityRoleMap): Deleted, became Accessibility::createPlatformRoleMap.
(roleValueToNSString): Deleted, became Accessibility::roleToPlatformString.
* platform/LocalizedStrings.cpp:
(WebCore::AXARIAContentGroupText):
(WebCore::AXHorizontalRuleDescriptionText):
(WebCore::AXMarkText):
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::AXARIAContentGroupText): Deleted, moved to LocalizedStrings.cpp.
(WebCore::AXHorizontalRuleDescriptionText): Deleted, moved to LocalizedStrings.cpp.
(WebCore::AXMarkText): Deleted, moved to LocalizedStrings.cpp.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm