AX: Support returning relative frames for accessibility
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jan 2019 09:18:43 +0000 (09:18 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 20 Jan 2019 09:18:43 +0000 (09:18 +0000)
commit5e650a328dc4148dc36f0f7c58c33219da448a57
tree6053ce8e90febaf35a36ee4679edd937f0d1123b
parent55ff053e0bb70f10b00d75991b52bdae90064ee0
AX: Support returning relative frames for accessibility
https://bugs.webkit.org/show_bug.cgi?id=193414
<rdar://problem/47268501>

Reviewed by Zalan Bujtas.

Source/WebCore:

Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.

Consolidate rect/point conversion methods for macOS and iOS.
This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.

Tests: accessibility/mac/relative-frame.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
(-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
(-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView accessibilityAttributeValue:forParameter:]):
(-[WKWebView IGNORE_WARNINGS_END]):
* UIProcess/API/mac/WKView.mm:
(-[WKView accessibilityAttributeValue:forParameter:]):
(-[WKView IGNORE_WARNINGS_END]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::accessibilityAttributeValue):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView accessibilityConvertRelativeFrameFromPage:]):

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::stringDescriptionOfAttributeValue):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::attributesOfElement):
(WTR::AccessibilityUIElement::stringDescriptionOfAttributeValue):

LayoutTests:

* accessibility/mac/relative-frame-expected.txt: Added.
* accessibility/mac/relative-frame.html: Added.
* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/relative-frame-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/relative-frame.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/mac/WKView.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm