AX: Support returning relative frames for accessibility
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2019 01:26:37 +0000 (01:26 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2019 01:26:37 +0000 (01:26 +0000)
commitf5c64a0f3a3f7430a17f0fe075b84f629a77c2fb
tree3dd469b6033c802c2d890833a6067a4cd0d834a2
parent6ad69a843b5db0e1da5d0772bbb395c79eb6335d
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@240219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 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/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp
Tools/WebKitTestRunner/InjectedBundle/wpe/AccessibilityUIElementWPE.cpp