AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark...
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 12:54:59 +0000 (12:54 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 12:54:59 +0000 (12:54 +0000)
commit943890d2f491315799554c89e4a1e3ec7ba118c8
tree3e8405df6e275ec3c382bef0fe0453ef97e9a2f5
parente1193a324fb4fecb50e931bde7eb3a8d94686c17
AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named
https://bugs.webkit.org/show_bug.cgi?id=157331

Reviewed by Chris Fleizach.

Source/WebCore:

The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole
AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion
subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to
the LandmarkRegionRole if it has an author-provided accessible name via either
the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole
with no subrole.

Our existing test coverage for exposure of the 'region' role and the 'section'
element is sufficient. These tests were updated to reflect the new behavior.
Several new test cases were added to cover both sections with accessible names
and those without.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
(WebCore::AccessibilityObject::isLandmark):
(WebCore::initializeRoleMap):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
* platform/LocalizedStrings.cpp:
(WebCore::AXARIAContentGroupText):

Source/WebKit/win:

As part of this change, the WebCore DocumentRegionRole AccessibilityRole has
been renamed to LandmarkRegionRole. Update MSAARole() to use the new name.

* AccessibleBase.cpp:
(MSAARole):

Tools:

Add AXLandmarkRegion to the landmark strings handled by roleToString
for objects with ATK_ROLE_LANDMARK.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

LayoutTests:

Our existing test coverage for exposure of the 'region' role and the 'section'
element is sufficient. These tests were updated to reflect the new behavior.
Several new test cases were added to cover both sections with accessible names
and those without.

* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* accessibility/mac/aria-grouping-roles-expected.txt: Updated.
* accessibility/mac/aria-grouping-roles.html: Updated.
* accessibility/mac/html-section-elements-expected.txt: Updated.
* accessibility/mac/html-section-elements.html: Updated.
* accessibility/mac/landmark-not-ignored-expected.txt: Updated.
* accessibility/mac/landmark-not-ignored.html: Updated.
* accessibility/roles-computedRoleString-expected.txt: Updated.
* accessibility/roles-computedRoleString.html: New test cases added.
* accessibility/roles-exposed.html: New test cases added.
* platform/efl/accessibility/roles-exposed-expected.txt: Updated.
* platform/gtk/accessibility/roles-computedRoleString-expected.txt: Updated.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated.
* platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated.
* platform/mac/accessibility/roles-exposed-expected.txt: Updated.
* platform/win/accessibility/roles-exposed-expected.txt: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt
LayoutTests/accessibility/mac/aria-grouping-roles-expected.txt
LayoutTests/accessibility/mac/aria-grouping-roles.html
LayoutTests/accessibility/mac/html-section-elements-expected.txt
LayoutTests/accessibility/mac/html-section-elements.html
LayoutTests/accessibility/mac/landmark-not-ignored-expected.txt
LayoutTests/accessibility/mac/landmark-not-ignored.html
LayoutTests/accessibility/roles-computedRoleString-expected.txt
LayoutTests/accessibility/roles-computedRoleString.html
LayoutTests/accessibility/roles-exposed.html
LayoutTests/platform/efl/accessibility/roles-exposed-expected.txt
LayoutTests/platform/gtk/accessibility/roles-computedRoleString-expected.txt
LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
LayoutTests/platform/win/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
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/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebKit/win/AccessibleBase.cpp
Source/WebKit/win/ChangeLog
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp