AX: [ATK] The pre element should be mapped to ATK_ROLE_SECTION; not ATK_ROLE_PANEL
https://bugs.webkit.org/show_bug.cgi?id=144702
Reviewed by Chris Fleizach.
Source/WebCore:
Add a new PreRole AccessibilityRole so that per-platform mapping is possible.
Map PreRole to ATK_ROLE_SECTION for Efl and Gtk; to NSAccessibilityGroupRole
for the Mac. Add PreRole to the list of "text type" ATK roles.
No new tests. Existing tests were updated to reflect the corrected mapping.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::allowsTextRanges):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
(roleIsTextType):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
LayoutTests:
In addition to updating the platform expectations for Efl and Gtk, the computed
roles test needed to be updated because there is not a one-to-one mapping between
the HTML pre element and any ARIA role type.
* accessibility/roles-computedRoleString-expected.txt: Updated.
* accessibility/roles-computedRoleString.html: Updated.
* platform/efl/accessibility/roles-exposed-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@183932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index 73fa12d..c3b7da40 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -633,6 +633,7 @@
return ATK_ROLE_BLOCK_QUOTE;
#endif
case DivRole:
+ case PreRole:
return ATK_ROLE_SECTION;
case FooterRole:
return ATK_ROLE_FOOTER;
@@ -1080,7 +1081,7 @@
static bool roleIsTextType(AccessibilityRole role)
{
return role == ParagraphRole || role == HeadingRole || role == DivRole || role == CellRole
- || role == LinkRole || role == WebCoreLinkRole || role == ListItemRole;
+ || role == LinkRole || role == WebCoreLinkRole || role == ListItemRole || role == PreRole;
}
static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)