AX: Implement support for ARIA 1.1 'switch' role
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2015 01:43:42 +0000 (01:43 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2015 01:43:42 +0000 (01:43 +0000)
commitb13d3d0fda71d78ecfb4ac9268274795bc046f00
tree16dbd5e49d52b675f820f20019bd7a052f125a43
parent9955a981c9fd4b68ad72e24184e318a9e5b3e152
AX: Implement support for ARIA 1.1 'switch' role
https://bugs.webkit.org/show_bug.cgi?id=141986

Reviewed by Chris Fleizach.

Source/WebCore:

Map the role to ATK_ROLE_TOGGLE_BUTTON for Gtk and Efl; on the Mac, to
AXCheckBox with a subrole of AXSwitch. Ensure it looks and acts like a
widget to accessibility APIs (supports and emits notifications when
toggled, doesn't have children, exposes a name and description when
provided).

Tests: accessibility/aria-switch-checked.html
       accessibility/aria-switch-sends-notification.html
       accessibility/aria-switch-text.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren):
(WebCore::AccessibilityNodeObject::isChecked):
(WebCore::AccessibilityNodeObject::visibleText):
(WebCore::AccessibilityNodeObject::title):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isARIAInput):
(WebCore::AccessibilityObject::actionVerb):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::supportsChecked):
(WebCore::AccessibilityObject::checkboxOrRadioValue):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isSwitch):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper accessibilityTraits]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

* accessibility/aria-switch-checked-expected.txt: Added.
* accessibility/aria-switch-checked.html: Added.
* accessibility/aria-switch-sends-notification-expected.txt: Added.
* accessibility/aria-switch-sends-notification.html: Added.
* accessibility/aria-switch-text.html: Added.
* accessibility/roles-exposed.html: Added a test case for the new role.
* platform/efl/accessibility/aria-fallback-roles-expected.txt: Added.
* platform/efl/accessibility/aria-switch-text-expected.txt: Added.
* platform/efl/accessibility/roles-exposed-expected.txt: Updated for the new role.
* platform/gtk/accessibility/aria-fallback-roles-expected.txt: Added.
* platform/gtk/accessibility/aria-switch-text-expected.txt: Added.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated for the new role.
* platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for the new role.
* platform/mac/TestExpectations: Skip the 'checked' notifcation as the Mac doesn't have it.
* platform/mac/accessibility/aria-switch-text-expected.txt: Added.
* platform/mac/accessibility/roles-exposed-expected.txt: Updated for the new role.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-switch-checked-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/aria-switch-checked.html [new file with mode: 0644]
LayoutTests/accessibility/aria-switch-sends-notification-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/aria-switch-sends-notification.html [new file with mode: 0644]
LayoutTests/accessibility/aria-switch-text.html [new file with mode: 0644]
LayoutTests/accessibility/roles-exposed.html
LayoutTests/platform/efl/accessibility/aria-fallback-roles-expected.txt [new file with mode: 0644]
LayoutTests/platform/efl/accessibility/aria-switch-text-expected.txt [new file with mode: 0644]
LayoutTests/platform/efl/accessibility/roles-exposed-expected.txt
LayoutTests/platform/gtk/accessibility/aria-fallback-roles-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/aria-switch-text-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/mac/accessibility/aria-switch-text-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm