AX: Support embedded SVG objects in AX tree
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2012 16:02:36 +0000 (16:02 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2012 16:02:36 +0000 (16:02 +0000)
commit42080b54e6e4148cd4e37e07b78860e58407a6f8
tree3e1dcd8684fdb05ec97ed6c42b34959ce094912f
parent0c849bb781ff1540ffcfe09dfe5543645fa24bbf
AX: Support embedded SVG objects in AX tree
https://bugs.webkit.org/show_bug.cgi?id=97571

Reviewed by Tim Horton.

Source/WebCore:

This patch allows an SVG image from another resource to be hooked into the AX
hierarchy. This is done by creating an AX wrapper for the root SVG that holds onto
its native parent image. The SVGChromeClient is then used to connect to this SVG resource.

Test: accessibility/svg-remote-element.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilitySVGRoot):
(AccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::detach):
(WebCore::AccessibilityRenderObject::offsetBoundingBoxForRemoteSVGElement):
(WebCore::AccessibilityRenderObject::boundingBoxRect):
(WebCore::AccessibilityRenderObject::remoteSVGElementHitTest):
(WebCore::AccessibilityRenderObject::elementAccessibilityHitTest):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::isSVGImage):
(WebCore::AccessibilityRenderObject::detachRemoteSVGRoot):
(WebCore::AccessibilityRenderObject::remoteSVGRootElement):
(WebCore::AccessibilityRenderObject::addRemoteSVGChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilitySVGRoot.cpp: Added.
(WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
(WebCore::AccessibilitySVGRoot::~AccessibilitySVGRoot):
(WebCore::AccessibilitySVGRoot::create):
(WebCore::AccessibilitySVGRoot::parentObject):
* accessibility/AccessibilitySVGRoot.h: Added.
(AccessibilitySVGRoot): Class provides ability to wrap the SVG root of a remote accessibility element.
(WebCore::AccessibilitySVGRoot::setParent):
(WebCore::AccessibilitySVGRoot::isAccessibilitySVGRoot):
(WebCore::toAccessibilitySVGRoot):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper position]): The position of AX elements within a remote SVG element needs to be handled
in a special manner.
(createAccessibilityRoleMap):
* loader/EmptyClients.h:
(EmptyChromeClient): Expose isEmptyChromeClient() so Accessibility will know when to apply different policies for finding
the accessibility bounding rect of elements.
(WebCore::EmptyChromeClient::isEmptyChromeClient):
* page/ChromeClient.h:
(WebCore::ChromeClient::isEmptyChromeClient):
(ChromeClient):
* svg/graphics/SVGImage.cpp:
* svg/graphics/SVGImageChromeClient.h: Added.
(SVGImageChromeClient): Expose the SVGImageChromeClient so that Accessibility can reference its image.
(WebCore::SVGImageChromeClient::SVGImageChromeClient):
(WebCore::SVGImageChromeClient::isSVGImageChromeClient):
(WebCore::SVGImageChromeClient::image):
(WebCore::SVGImageChromeClient::chromeDestroyed):
(WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
(WebCore::toSVGImageChromeClient):

LayoutTests:

Added a new test that links in an svg file. Accessibility of that remote svg file is tested.
Test skipped on chromium until clickPoint() is implemented in DRT.

* accessibility/svg-remote-element.html: Added.
* accessibility/resources/svg-face.svg: Added.
* platform/chromium/TestExpectations:
* platform/mac/accessibility/svg-remote-element-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/resources/svg-face.svg [new file with mode: 0644]
LayoutTests/accessibility/svg-remote-element.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityAllInOne.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.h
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/AccessibilitySVGRoot.cpp [new file with mode: 0644]
Source/WebCore/accessibility/AccessibilitySVGRoot.h [new file with mode: 0644]
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImageChromeClient.h [new file with mode: 0644]
Source/WebKit/chromium/public/WebAccessibilityRole.h
Source/WebKit/chromium/src/AssertMatchingEnums.cpp