AX: The bounding paths should be made available through accessibility
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 18:53:19 +0000 (18:53 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2013 18:53:19 +0000 (18:53 +0000)
commit898da8ef500646c3393edfaf168e093df6f99f3c
tree7d80aa44368ddd4d0bb1af2191c67c4cebcdd3e9
parentd5b06c83b30328aaf7020a08ccef980ba0b14ed0
AX: The bounding paths should be made available through accessibility
https://bugs.webkit.org/show_bug.cgi?id=113817

Reviewed by David Kilzer.

Source/WebCore:

This allows bounding paths to be returned for some web elements (image map areas and SVG shapes).
This provides more accuracy when assistive technologies highlight elements.
The Mac and iOS platforms share some code to help transform paths to their screen coordinates.

Tests: platform/iphone-simulator/accessibility/element-paths.html
       platform/mac/accessibility/element-paths.html

* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
(WebCore):
(WebCore::AccessibilityImageMapLink::elementPath):
(WebCore::AccessibilityImageMapLink::elementRect):
* accessibility/AccessibilityImageMapLink.h:
(AccessibilityImageMapLink):
(WebCore::AccessibilityImageMapLink::supportsPath):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::elementPath):
(WebCore::AccessibilityObject::supportsPath):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore):
(WebCore::AccessibilityRenderObject::supportsPath):
(WebCore::AccessibilityRenderObject::elementPath):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityPath]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
(WebCore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(PathConversionInfo):
(ConvertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(WebTransformCGPathToNSBezierPath):
(-[WebAccessibilityObjectWrapper bezierPathFromPath:]):
(-[WebAccessibilityObjectWrapper path]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

Add a pathDescription property for testing so that it's possible
to verify that a path is being returned correctly.

* DumpRenderTree/AccessibilityUIElement.cpp:
(getPathDescriptionCallback):
(AccessibilityUIElement::pathDescription):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(_CGPathEnumerationIteration):
(AccessibilityUIElement::pathDescription):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::pathDescription):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::pathDescription):
(WTR):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(AccessibilityUIElement):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::pathDescription):
(WTR):

LayoutTests:

Add new tests for Mac and iOS to verify that path output works.
Modify existing tests to indicate that there is a new AXAttribute, AXPath.

* platform/iphone-simulator/accessibility/element-paths-expected.txt: Added.
* platform/iphone-simulator/accessibility/element-paths.html: Added.
* platform/mac/accessibility/document-links-expected.txt:
* platform/mac/accessibility/element-paths-expected.txt: Added.
* platform/mac/accessibility/element-paths.html: Added.
* platform/mac/accessibility/image-map2-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/iphone-simulator/accessibility/element-paths-expected.txt [new file with mode: 0644]
LayoutTests/platform/iphone-simulator/accessibility/element-paths.html [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/document-links-expected.txt
LayoutTests/platform/mac/accessibility/element-paths-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/element-paths.html [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/image-map2-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
Source/WebCore/accessibility/AccessibilityImageMapLink.h
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm