AX: Implement missing/different accessibility API mappings for SVG
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2016 21:35:57 +0000 (21:35 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2016 21:35:57 +0000 (21:35 +0000)
commite39f855a8a3bb80b490f38a16c6fdd18546d0bf9
treeb1a151869242c483a128238b198f76e26c3410df
parenta03994873acc52e890762750e041f6736c63bbe4
AX: Implement missing/different accessibility API mappings for SVG
https://bugs.webkit.org/show_bug.cgi?id=155034

Reviewed by Chris Fleizach.

Source/WebCore:

Create an AccessibilitySVGElement class for the SVG-specific mappings;
fix name and description mappings for ATK; add new AccessibilityRole
types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
ATK and AX API.

Tests: accessibility/w3c-svg-description-calculation.html
       accessibility/w3c-svg-elements-not-exposed.html
       accessibility/w3c-svg-name-calculation.html
       accessibility/w3c-svg-presentational-role.html
       accessibility/w3c-svg-roles.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText): Deleted.
(WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilitySVGElement):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
* accessibility/AccessibilitySVGElement.cpp: Added.
(WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
(WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
(WebCore::AccessibilitySVGElement::create):
(WebCore::AccessibilitySVGElement::targetForUseElement):
(WebCore::AccessibilitySVGElement::accessibilityText):
(WebCore::AccessibilitySVGElement::accessibilityDescription):
(WebCore::AccessibilitySVGElement::helpText):
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
(WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
(WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
(WebCore::AccessibilitySVGElement::determineAccessibilityRole):
* accessibility/AccessibilitySVGElement.h: Added.
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
* rendering/RenderObject.h:
(WebCore::RenderObject::isSVGTSpan):
* rendering/svg/RenderSVGTSpan.h:

LayoutTests:

* accessibility/svg-group-element-with-title.html: Modified to reflect correct ATK results.
* accessibility/svg-image.html: Modified to reflect correct ATK results.
* accessibility/svg-labelledby.html: Modified to reflect correct ATK results.
* accessibility/svg-remote-element.html: Modified to reflect correct ATK results.
* accessibility/w3c-svg-description-calculation.html: Added.
* accessibility/w3c-svg-elements-not-exposed.html: Added.
* accessibility/w3c-svg-name-calculation.html: Added.
* accessibility/w3c-svg-presentational-role.html: Added.
* accessibility/w3c-svg-roles.html: Added.
* platform/gtk/accessibility/svg-group-element-with-title-expected.txt: Added.
* platform/gtk/accessibility/svg-image-expected.txt: Added.
* platform/gtk/accessibility/svg-labelledby-expected.txt: Added.
* platform/gtk/accessibility/svg-remote-element-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-roles-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-description-calculation-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-name-calculation-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-presentational-role-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-roles-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/svg-group-element-with-title.html
LayoutTests/accessibility/svg-image.html
LayoutTests/accessibility/svg-labelledby.html
LayoutTests/accessibility/svg-remote-element.html
LayoutTests/accessibility/w3c-svg-description-calculation.html [new file with mode: 0644]
LayoutTests/accessibility/w3c-svg-elements-not-exposed.html [new file with mode: 0644]
LayoutTests/accessibility/w3c-svg-name-calculation.html [new file with mode: 0644]
LayoutTests/accessibility/w3c-svg-presentational-role.html [new file with mode: 0644]
LayoutTests/accessibility/w3c-svg-roles.html [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/svg-group-element-with-title-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/svg-image-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/svg-labelledby-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/svg-remote-element-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/w3c-svg-roles-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/w3c-svg-description-calculation-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/w3c-svg-name-calculation-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/w3c-svg-presentational-role-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/w3c-svg-roles-expected.txt [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityAllInOne.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilitySVGElement.cpp [new file with mode: 0644]
Source/WebCore/accessibility/AccessibilitySVGElement.h [new file with mode: 0644]
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/svg/RenderSVGTSpan.h