AX: Make SVG Group containers accessible elements
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2013 21:56:58 +0000 (21:56 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2013 21:56:58 +0000 (21:56 +0000)
commit5866ec009168c283bb397fa9dc59494f8f0af375
treef6ac6d77c6ec8ba4123a813a68584dc483d68e2e
parentdf6db6843641c663e7fbf3ca2ebb81376e8c68a2
AX: Make SVG Group containers accessible elements
https://bugs.webkit.org/show_bug.cgi?id=113939

Reviewed by Simon Fraser.

Source/WebCore:

SVG group containers are currently not exposed in the AX tree.
When an SVG element has a <title> child, that is not being used for the AX label.
When hit-testing, from Accessibility, SVG groups are never returned.

All these issues are fixed for Mac and iOS.
There are two tests because right now iOS skips all the top-level accessibility tests
due to fundamental architectural differences.

Tests: accessibility/svg-group-element-with-title.html
       platform/iphone-simulator/accessibility/svg-group-element-with-title.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText):
(WebCore::AccessibilityNodeObject::accessibilityDescription):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper isSVGGroupElement]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper accessibilityClickPoint]):
* rendering/HitTestRequest.h:
    Add a new option, AccessibilityHitTest, that will allow us to override normal behavior.
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
   Allow a SVG group to be the node at a point, for accessibility hit tests.

Tools:

Implement axController.elementAtPoint for iOS.
Implement a correct version of clickPoint for iOS.

* DumpRenderTree/ios/AccessibilityControllerIOS.mm:
(AccessibilityController::elementAtPoint):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::clickPointX):
(AccessibilityUIElement::clickPointY):

LayoutTests:

* accessibility/svg-group-element-with-title-expected.txt: Added.
* accessibility/svg-group-element-with-title.html: Added.
* platform/iphone-simulator/accessibility/svg-group-element-with-title-expected.txt: Added.
* platform/iphone-simulator/accessibility/svg-group-element-with-title.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/svg-group-element-with-title-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/svg-group-element-with-title.html [new file with mode: 0644]
LayoutTests/platform/iphone-simulator/accessibility/svg-group-element-with-title-expected.txt [new file with mode: 0644]
LayoutTests/platform/iphone-simulator/accessibility/svg-group-element-with-title.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/rendering/HitTestRequest.h
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Tools/ChangeLog
Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm