AX: WebCore accessibility roles should be cross-platform
https://bugs.webkit.org/show_bug.cgi?id=94870
Reviewed by Chris Fleizach.
Source/WebCore:
Make 5 accessibility roles cross-platform rather than GTK-only.
Instead of mapping the HR tag to SplitterRole (which is an interactive
splitter control on Mac), create a new role HorizontalRuleRole.
Map all of the new roles to AXGroup on Mac, which matches the existing
behavior. Add a new test for these roles on Chromium.
Test: platform/chromium/accessibility/chromium-only-roles.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/gtk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/gtk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(createAccessibilityRoleMap):
Source/WebKit/chromium:
Add a new accessibility role.
* public/WebAccessibilityRole.h:
* src/AssertMatchingEnums.cpp:
Tools:
Add debug strings to Chromium for new accessibility roles.
* DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp:
(roleToString):
LayoutTests:
Adds a test for some new accessibility roles that aren't present on all platforms.
* platform/chromium/accessibility/chromium-only-roles-expected.txt: Added.
* platform/chromium/accessibility/chromium-only-roles.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp
index 7bccad8..ec99037 100644
--- a/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp
@@ -476,7 +476,7 @@
case SplitGroupRole:
return ATK_ROLE_SPLIT_PANE;
case SplitterRole:
- return ATK_ROLE_SEPARATOR;
+ return ATK_ROLE_UNKNOWN;
case ColorWellRole:
return ATK_ROLE_COLOR_CHOOSER;
case ListRole:
@@ -526,6 +526,8 @@
return ATK_ROLE_FORM;
case CanvasRole:
return ATK_ROLE_CANVAS;
+ case HorizontalRuleRole:
+ return ATK_ROLE_SEPARATOR;
default:
return ATK_ROLE_UNKNOWN;
}