WebKit Bugzilla
Attachment 359097 Details for
Bug 193414
: AX: Support returning relative frames for accessibility
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch (text/plain), 33.51 KB, created by
chris fleizach
on 2019-01-14 16:32:59 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2019-01-14 16:32:59 PST
Size:
33.51 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 239843) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,39 @@ >+2019-01-14 chris fleizach <cfleizach@apple.com> >+ >+ AX: Support returning relative frames for accessibility >+ https://bugs.webkit.org/show_bug.cgi?id=193414 >+ <rdar://problem/47268501> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ > 2019-01-10 Wenson Hsieh <wenson_hsieh@apple.com> > > Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute >Index: Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (revision 239843) >+++ Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (working copy) >@@ -1499,7 +1499,7 @@ > return point; > > FloatPoint floatPoint = FloatPoint(point); >- return [self convertPointToScreenSpace:floatPoint]; >+ return [self convertRectToSpace:FloatRect(floatPoint, FloatSize()) space:ScreenSpace]; > } > > - (BOOL)accessibilityPerformEscape >@@ -1560,104 +1560,12 @@ > return result; > } > >-- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point >+- (CGRect)_accessibilityRelativeFrame > { >- if (!m_object) >- return CGPointZero; >- >- CGPoint cgPoint = CGPointMake(point.x(), point.y()); >- >- FrameView* frameView = m_object->documentFrameView(); >- WAKView* documentView = frameView ? frameView->documentView() : nullptr; >- if (documentView) { >- cgPoint = [documentView convertPoint:cgPoint toView:nil]; >- >- // we need the web document view to give us our final screen coordinates >- // because that can take account of the scroller >- id webDocument = [self _accessibilityWebDocumentView]; >- if (webDocument) >- cgPoint = [webDocument convertPoint:cgPoint toView:nil]; >- } >- else { >- // Find the appropriate scroll view to use to convert the contents to the window. >- ScrollView* scrollView = nullptr; >- const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) { >- return is<AccessibilityScrollView>(object); >- }); >- if (parent) >- scrollView = downcast<AccessibilityScrollView>(*parent).scrollView(); >- >- IntPoint intPoint = flooredIntPoint(point); >- if (scrollView) >- intPoint = scrollView->contentsToRootView(intPoint); >- >- Page* page = m_object->page(); >- >- // If we have an empty chrome client (like SVG) then we should use the page >- // of the scroll view parent to help us get to the screen rect. >- if (parent && page && page->chrome().client().isEmptyChromeClient()) >- page = parent->page(); >- >- if (page) { >- IntRect rect = IntRect(intPoint, IntSize(0, 0)); >- intPoint = page->chrome().rootViewToAccessibilityScreen(rect).location(); >- } >- >- cgPoint = (CGPoint)intPoint; >- } >- >- return cgPoint; >+ IntRect rect = snappedIntRect(m_object->elementRect()); >+ return [self convertRectToSpace:FloatRect(rect) space:PageSpace]; > } > >-- (CGRect)convertRectToScreenSpace:(IntRect &)rect >-{ >- if (!m_object) >- return CGRectZero; >- >- CGSize size = CGSizeMake(rect.size().width(), rect.size().height()); >- CGPoint point = CGPointMake(rect.x(), rect.y()); >- >- CGRect frame = CGRectMake(point.x, point.y, size.width, size.height); >- >- FrameView* frameView = m_object->documentFrameView(); >- WAKView* documentView = frameView ? frameView->documentView() : nil; >- if (documentView) { >- frame = [documentView convertRect:frame toView:nil]; >- >- // we need the web document view to give us our final screen coordinates >- // because that can take account of the scroller >- id webDocument = [self _accessibilityWebDocumentView]; >- if (webDocument) >- frame = [webDocument convertRect:frame toView:nil]; >- >- } else { >- // Find the appropriate scroll view to use to convert the contents to the window. >- ScrollView* scrollView = nullptr; >- const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) { >- return is<AccessibilityScrollView>(object); >- }); >- if (parent) >- scrollView = downcast<AccessibilityScrollView>(*parent).scrollView(); >- >- if (scrollView) >- rect = scrollView->contentsToRootView(rect); >- >- Page* page = m_object->page(); >- >- // If we have an empty chrome client (like SVG) then we should use the page >- // of the scroll view parent to help us get to the screen rect. >- if (parent && page && page->chrome().client().isEmptyChromeClient()) >- page = parent->page(); >- >- if (page) >- rect = page->chrome().rootViewToAccessibilityScreen(rect); >- >- frame = (CGRect)rect; >- } >- >- return frame; >-} >- > // Used by UIKit accessibility bundle to help determine distance during a hit-test. > - (CGRect)accessibilityElementRect > { >@@ -1677,7 +1585,7 @@ > if (!document || !document->view()) > return CGRectZero; > IntRect rect = snappedIntRect(document->view()->unobscuredContentRect()); >- return [self convertRectToScreenSpace:rect]; >+ return [self convertRectToSpace:rect space:ScreenSpace]; > } > > // The "center point" is where VoiceOver will "press" an object. This may not be the actual >@@ -1688,7 +1596,7 @@ > return CGPointZero; > > IntRect rect = snappedIntRect(m_object->boundingBoxRect()); >- CGRect cgRect = [self convertRectToScreenSpace:rect]; >+ CGRect cgRect = [self convertRectToSpace:rect space:ScreenSpace]; > return CGPointMake(CGRectGetMidX(cgRect), CGRectGetMidY(cgRect)); > } > >@@ -1698,7 +1606,7 @@ > return CGRectZero; > > IntRect rect = snappedIntRect(m_object->elementRect()); >- return [self convertRectToScreenSpace:rect]; >+ return [self convertRectToSpace:rect space:ScreenSpace]; > } > > // Checks whether a link contains only static text and images (and has been divided unnaturally by <spans> and other nefarious mechanisms). >@@ -2743,7 +2651,7 @@ > return CGRectZero; > > IntRect rect = m_object->boundsForRange(range); >- return [self convertRectToScreenSpace:rect]; >+ return [self convertRectToSpace:rect space:ScreenSpace]; > } > > - (RefPtr<Range>)rangeFromMarkers:(NSArray *)markers withText:(NSString *)text >@@ -2789,7 +2697,7 @@ > for (unsigned i = 0; i < size; i++) { > const WebCore::SelectionRect& coreRect = selectionRects[i]; > IntRect selectionRect = coreRect.rect(); >- CGRect rect = [self convertRectToScreenSpace:selectionRect]; >+ CGRect rect = [self convertRectToSpace:selectionRect space:ScreenSpace]; > [rects addObject:[NSValue valueWithRect:rect]]; > } > >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h (revision 239843) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h (working copy) >@@ -65,8 +65,10 @@ > - (void)accessibilityPostedNotification:(NSString *)notificationName userInfo:(NSDictionary *)userInfo; > > - (CGPathRef)convertPathToScreenSpace:(WebCore::Path &)path; >-- (CGPoint)convertPointToScreenSpace:(WebCore::FloatPoint &)point; > >+enum ConversionSpace { ScreenSpace, PageSpace }; >+- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space; >+ > // Math related functions > - (NSArray *)accessibilityMathPostscriptPairs; > - (NSArray *)accessibilityMathPrescriptPairs; >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (revision 239843) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (working copy) >@@ -42,6 +42,8 @@ > #import "AccessibilityTableCell.h" > #import "AccessibilityTableColumn.h" > #import "AccessibilityTableRow.h" >+#import "Chrome.h" >+#import "ChromeClient.h" > #import "ColorMac.h" > #import "ContextMenuController.h" > #import "Editing.h" >@@ -51,6 +53,7 @@ > #import "FrameLoaderClient.h" > #import "FrameSelection.h" > #import "HTMLNames.h" >+#import "LayoutRect.h" > #import "LocalizedStrings.h" > #import "Page.h" > #import "RenderTextControl.h" >@@ -461,31 +464,42 @@ > { > WebAccessibilityObjectWrapperBase *wrapper = conversion.wrapper; > CGMutablePathRef newPath = conversion.path; >+ FloatRect rect; > switch (element.type) { > case PathElementMoveToPoint: > { >- CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]]; >+ rect = FloatRect(element.points[0], FloatSize()); >+ CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; > CGPathMoveToPoint(newPath, nil, newPoint.x, newPoint.y); > break; > } > case PathElementAddLineToPoint: > { >- CGPoint newPoint = [wrapper convertPointToScreenSpace:element.points[0]]; >+ rect = FloatRect(element.points[0], FloatSize()); >+ CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; > CGPathAddLineToPoint(newPath, nil, newPoint.x, newPoint.y); > break; > } > case PathElementAddQuadCurveToPoint: > { >- CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]]; >- CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]]; >+ rect = FloatRect(element.points[0], FloatSize()); >+ CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ >+ rect = FloatRect(element.points[1], FloatSize()); >+ CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; > CGPathAddQuadCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y); > break; > } > case PathElementAddCurveToPoint: > { >- CGPoint newPoint1 = [wrapper convertPointToScreenSpace:element.points[0]]; >- CGPoint newPoint2 = [wrapper convertPointToScreenSpace:element.points[1]]; >- CGPoint newPoint3 = [wrapper convertPointToScreenSpace:element.points[2]]; >+ rect = FloatRect(element.points[0], FloatSize()); >+ CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ >+ rect = FloatRect(element.points[1], FloatSize()); >+ CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ >+ rect = FloatRect(element.points[2], FloatSize()); >+ CGPoint newPoint3 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; > CGPathAddCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y, newPoint3.x, newPoint3.y); > break; > } >@@ -507,11 +521,73 @@ > return conversion.path; > } > >-- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point >+- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space > { >- UNUSED_PARAM(point); >- ASSERT_NOT_REACHED(); >- return CGPointZero; >+ if (!m_object) >+ return CGRectZero; >+ >+ CGSize size = CGSizeMake(rect.size().width(), rect.size().height()); >+ CGPoint point = CGPointMake(rect.x(), rect.y()); >+ >+ CGRect cgRect = CGRectMake(point.x, point.y, size.width, size.height); >+ >+ // WebKit1 code path... platformWidget() exists. >+ FrameView* frameView = m_object->documentFrameView(); >+#if PLATFORM(IOS_FAMILY) >+ WAKView* documentView = frameView ? frameView->documentView() : nullptr; >+ if (documentView) { >+ cgRect = [documentView convertRect:cgRect toView:nil]; >+ >+ // we need the web document view to give us our final screen coordinates >+ // because that can take account of the scroller >+ id webDocument = [self _accessibilityWebDocumentView]; >+ if (webDocument) >+ cgRect = [webDocument convertRect:cgRect toView:nil]; >+ } >+#else >+ if (frameView && frameView->platformWidget()) { >+ NSRect nsRect = NSRectFromCGRect(cgRect); >+ NSView* view = frameView->documentView(); >+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN >+ nsRect = [[view window] convertRectToScreen:[view convertRect:nsRect toView:nil]]; >+ ALLOW_DEPRECATED_DECLARATIONS_END >+ cgRect = NSRectToCGRect(nsRect); >+ } >+#endif >+ else { >+ // Find the appropriate scroll view to use to convert the contents to the window. >+ ScrollView* scrollView = nullptr; >+ const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) { >+ return is<AccessibilityScrollView>(object); >+ }); >+ if (parent) >+ scrollView = downcast<AccessibilityScrollView>(*parent).scrollView(); >+ >+ IntRect intRect = snappedIntRect(IntRect(cgRect)); >+ if (scrollView) >+ intRect = scrollView->contentsToRootView(intRect); >+ >+ if (space == ScreenSpace) { >+ Page* page = m_object->page(); >+ >+ // If we have an empty chrome client (like SVG) then we should use the page >+ // of the scroll view parent to help us get to the screen rect. >+ if (parent && page && page->chrome().client().isEmptyChromeClient()) >+ page = parent->page(); >+ >+ if (page) { >+#if PLATFORM(IOS_FAMILY) >+ intRect = page->chrome().rootViewToAccessibilityScreen(intRect); >+#else >+ intRect = page->chrome().rootViewToScreen(intRect); >+#endif >+ } >+ } >+ >+ cgRect = (CGRect)intRect; >+ } >+ >+ return cgRect; > } > > - (NSString *)ariaLandmarkRoleDescription >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (revision 239843) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (working copy) >@@ -412,6 +412,10 @@ > #define NSAccessibilityLinkRelationshipTypeAttribute @"AXLinkRelationshipType" > #endif > >+#ifndef NSAccessibilityRelativeFrameAttribute >+#define NSAccessibilityRelativeFrameAttribute @"AXRelativeFrame" >+#endif >+ > extern "C" AXUIElementRef NSAccessibilityCreateAXUIElementRef(id element); > > @implementation WebAccessibilityObjectWrapper >@@ -1320,6 +1324,7 @@ > NSAccessibilityFocusableAncestorAttribute, > NSAccessibilityEditableAncestorAttribute, > NSAccessibilityHighestEditableAncestorAttribute, >+ NSAccessibilityRelativeFrameAttribute, > nil]; > } > if (commonMenuAttrs == nil) { >@@ -1746,50 +1751,6 @@ > return static_cast<PluginViewBase*>(pluginWidget)->accessibilityAssociatedPluginParentForElement(m_object->element()); > } > >-- (CGPoint)convertPointToScreenSpace:(FloatPoint &)point >-{ >- FrameView* frameView = m_object->documentFrameView(); >- >- // WebKit1 code path... platformWidget() exists. >- if (frameView && frameView->platformWidget()) { >- NSPoint nsPoint = (NSPoint)point; >- NSView* view = frameView->documentView(); >- ALLOW_DEPRECATED_DECLARATIONS_BEGIN >- nsPoint = [[view window] convertBaseToScreen:[view convertPoint:nsPoint toView:nil]]; >- ALLOW_DEPRECATED_DECLARATIONS_END >- return CGPointMake(nsPoint.x, nsPoint.y); >- } else { >- >- // Find the appropriate scroll view to use to convert the contents to the window. >- ScrollView* scrollView = nullptr; >- AccessibilityObject* parent = nullptr; >- for (parent = m_object->parentObject(); parent; parent = parent->parentObject()) { >- if (is<AccessibilityScrollView>(*parent)) { >- scrollView = downcast<AccessibilityScrollView>(*parent).scrollView(); >- break; >- } >- } >- >- IntPoint intPoint = flooredIntPoint(point); >- if (scrollView) >- intPoint = scrollView->contentsToRootView(intPoint); >- >- Page* page = m_object->page(); >- >- // If we have an empty chrome client (like SVG) then we should use the page >- // of the scroll view parent to help us get to the screen rect. >- if (parent && page && page->chrome().client().isEmptyChromeClient()) >- page = parent->page(); >- >- if (page) { >- IntRect rect = IntRect(intPoint, IntSize(0, 0)); >- intPoint = page->chrome().rootViewToScreen(rect).location(); >- } >- >- return intPoint; >- } >-} >- > static void WebTransformCGPathToNSBezierPath(void* info, const CGPathElement *element) > { > NSBezierPath *bezierPath = (__bridge NSBezierPath *)info; >@@ -1841,9 +1802,9 @@ > // The Cocoa accessibility API wants the lower-left corner. > FloatPoint floatPoint = FloatPoint(rect.x(), rect.maxY()); > >- CGPoint cgPoint = [self convertPointToScreenSpace:floatPoint]; >- >- return [NSValue valueWithPoint:NSMakePoint(cgPoint.x, cgPoint.y)]; >+ FloatRect floatRect = FloatRect(floatPoint, FloatSize()); >+ CGPoint cgPoint = [self convertRectToSpace:floatRect space:ScreenSpace].origin; >+ return [NSValue valueWithPoint:NSPointFromCGPoint(cgPoint)]; > } > > using AccessibilityRoleMap = HashMap<int, CFStringRef>; >@@ -3223,6 +3184,11 @@ > return convertToNSArray(details); > } > >+ if ([attributeName isEqualToString:NSAccessibilityRelativeFrameAttribute]) { >+ FloatRect rect = FloatRect(snappedIntRect(m_object->elementRect())); >+ return [NSValue valueWithRect:[self convertRectToSpace:rect space:PageSpace]]; >+ } >+ > if ([attributeName isEqualToString:@"AXErrorMessageElements"]) { > AccessibilityObject::AccessibilityChildrenVector errorMessages; > m_object->ariaErrorMessageElements(errorMessages); >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239843) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2019-01-14 chris fleizach <cfleizach@apple.com> >+ >+ AX: Support returning relative frames for accessibility >+ https://bugs.webkit.org/show_bug.cgi?id=193414 >+ <rdar://problem/47268501> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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:]): >+ > 2019-01-10 Zalan Bujtas <zalan@apple.com> > > REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 239843) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -3983,6 +3983,21 @@ > return _impl->accessibilityAttributeValue(attribute); > } > >+IGNORE_WARNINGS_BEGIN("deprecated-implementations") >+- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter >+IGNORE_WARNINGS_END >+{ >+ return _impl->accessibilityAttributeValue(attribute, parameter); >+} >+ >+IGNORE_WARNINGS_BEGIN("deprecated-implementations") >+- (NSArray<NSString *> *)accessibilityParameterizedAttributeNames >+IGNORE_WARNINGS_END >+{ >+ NSArray<NSString *> *names = [super accessibilityParameterizedAttributeNames]; >+ return [names arrayByAddingObject:@"AXConvertRelativeFrame"]; >+} >+ > - (NSView *)hitTest:(NSPoint)point > { > if (!_impl) >Index: Source/WebKit/UIProcess/API/mac/WKView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/mac/WKView.mm (revision 239843) >+++ Source/WebKit/UIProcess/API/mac/WKView.mm (working copy) >@@ -809,6 +809,21 @@ > return _data->_impl->accessibilityAttributeValue(attribute); > } > >+IGNORE_WARNINGS_BEGIN("deprecated-implementations") >+- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter >+IGNORE_WARNINGS_END >+{ >+ return _data->_impl->accessibilityAttributeValue(attribute, parameter); >+} >+ >+IGNORE_WARNINGS_BEGIN("deprecated-implementations") >+- (NSArray<NSString *> *)accessibilityParameterizedAttributeNames >+IGNORE_WARNINGS_END >+{ >+ NSArray<NSString *> *names = [super accessibilityParameterizedAttributeNames]; >+ return [names arrayByAddingObject:@"AXConvertRelativeFrame"]; >+} >+ > - (NSView *)hitTest:(NSPoint)point > { > if (!_data) >Index: Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (revision 239843) >+++ Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (working copy) >@@ -408,7 +408,7 @@ > bool accessibilityIsIgnored() const { return false; } > id accessibilityHitTest(CGPoint); > void enableAccessibilityIfNecessary(); >- id accessibilityAttributeValue(NSString *); >+ id accessibilityAttributeValue(NSString *, id parameter = nil); > > NSTrackingArea *primaryTrackingArea() const { return m_primaryTrackingArea.get(); } > void setPrimaryTrackingArea(NSTrackingArea *); >Index: Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (revision 239843) >+++ Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (working copy) >@@ -3576,7 +3576,7 @@ > updateWindowAndViewFrames(); > } > >-id WebViewImpl::accessibilityAttributeValue(NSString *attribute) >+id WebViewImpl::accessibilityAttributeValue(NSString *attribute, id parameter) > { > enableAccessibilityIfNecessary(); > >@@ -3599,6 +3599,13 @@ > if ([attribute isEqualToString:NSAccessibilityEnabledAttribute]) > return @YES; > >+ if ([attribute isEqualToString:@"AXConvertRelativeFrame"]) { >+ if ([parameter isKindOfClass:[NSValue class]]) { >+ NSRect rect = [(NSValue *)parameter rectValue]; >+ return [NSValue valueWithRect:m_pageClient->rootViewToScreen(IntRect(rect))]; >+ } >+ } >+ > return [m_view _web_superAccessibilityAttributeValue:attribute]; > } > >Index: Source/WebKit/UIProcess/ios/WKContentView.mm >=================================================================== >--- Source/WebKit/UIProcess/ios/WKContentView.mm (revision 239843) >+++ Source/WebKit/UIProcess/ios/WKContentView.mm (working copy) >@@ -510,6 +510,11 @@ > } > } > >+- (CGRect)accessibilityConvertRelativeFrameFromPage:(CGRect)frame >+{ >+ return _pageClient->rootViewToAccessibilityScreen(IntRect(frame)); >+} >+ > - (void)_webViewDestroyed > { > _webView = nil; >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 239959) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-01-14 chris fleizach <cfleizach@apple.com> >+ >+ AX: Support returning relative frames for accessibility >+ https://bugs.webkit.org/show_bug.cgi?id=193414 >+ <rdar://problem/47268501> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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): >+ > 2019-01-14 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r239901, r239909, r239910, r239912, >Index: Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (revision 239843) >+++ Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (working copy) >@@ -109,6 +109,7 @@ > #endif > > // Attributes - platform-independent implementations >+ JSRetainPtr<JSStringRef> stringDescriptionOfAttributeValue(JSStringRef attribute); > JSRetainPtr<JSStringRef> stringAttributeValue(JSStringRef attribute); > double numberAttributeValue(JSStringRef attribute); > JSValueRef uiElementArrayAttributeValue(JSStringRef attribute) const; >Index: Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (revision 239843) >+++ Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (working copy) >@@ -58,6 +58,7 @@ > readonly attribute long insertionPointLineNumber; > readonly attribute DOMString selectedTextRange; > >+ DOMString stringDescriptionOfAttributeValue(DOMString attr); > DOMString stringAttributeValue(DOMString attr); > double numberAttributeValue(DOMString attr); > object uiElementArrayAttributeValue(DOMString attr); >Index: Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (revision 239843) >+++ Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (working copy) >@@ -348,6 +348,11 @@ > return createEmptyJSString(); > } > >+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringDescriptionOfAttributeValue(JSStringRef attribute) >+{ >+ return createEmptyJSString(); >+} >+ > JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute) > { > if (JSStringIsEqualToUTF8CString(attribute, "AXPlaceholderValue")) >Index: Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (revision 239843) >+++ Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (working copy) >@@ -178,7 +178,10 @@ > // Skip screen-specific information. > if ([attribute isEqualToString:@"_AXPrimaryScreenHeight"]) > continue; >- >+ >+ if ([attribute isEqualToString:@"AXRelativeFrame"]) >+ continue; >+ > // accessibilityAttributeValue: can throw an if an attribute is not returned. > // For DumpRenderTree's purpose, we should ignore those exceptions > BEGIN_AX_OBJC_EXCEPTIONS >@@ -556,6 +559,15 @@ > NSString* attributes = attributesOfElement(m_element); > return [attributes createJSStringRef]; > } >+ >+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringDescriptionOfAttributeValue(JSStringRef attribute) >+{ >+ BEGIN_AX_OBJC_EXCEPTIONS >+ NSString *value = descriptionOfValue([m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]], m_element); >+ return [value createJSStringRef]; >+ END_AX_OBJC_EXCEPTIONS >+ return nullptr; >+} > > JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute) > { >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 239843) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,30 @@ >+2019-01-14 chris fleizach <cfleizach@apple.com> >+ >+ AX: Support returning relative frames for accessibility >+ https://bugs.webkit.org/show_bug.cgi?id=193414 >+ <rdar://problem/47268501> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/ios-simulator/text-context-attributes-expected.txt: Replaced. >+ * accessibility/ios-simulator/text-context-attributes.html: Replaced. >+ * accessibility/mac/linkrel-expected.txt: Replaced. >+ * accessibility/mac/linkrel.html: Replaced. >+ * accessibility/mac/relative-frame-expected.txt: Added. >+ * accessibility/mac/relative-frame.html: Added. >+ * platform/mac-wk1/TestExpectations: >+ >+2018-10-16 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: Certain tags should identify their context to iOS API >+ https://bugs.webkit.org/show_bug.cgi?id=190622 >+ <rdar://problem/45308194> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/ios-simulator/text-context-attributes.html: Added. >+ * accessibility/ios-simulator/text-context-attributes-expcted.txt: Added. >+ > 2019-01-10 Eric Carlson <eric.carlson@apple.com> > > Define page media state flags for display capture. >Index: LayoutTests/accessibility/mac/relative-frame-expected.txt >=================================================================== >--- LayoutTests/accessibility/mac/relative-frame-expected.txt (nonexistent) >+++ LayoutTests/accessibility/mac/relative-frame-expected.txt (working copy) >@@ -0,0 +1,12 @@ >+focusable link >+This tests the relative frame attribute returns accurate data. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+position: NSPoint: {-9992, 11414} >+relative frame: NSRect: {{8, 8}, {90, 18}} >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/accessibility/mac/relative-frame.html >=================================================================== >--- LayoutTests/accessibility/mac/relative-frame.html (nonexistent) >+++ LayoutTests/accessibility/mac/relative-frame.html (working copy) >@@ -0,0 +1,32 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script> >+var successfullyParsed = false; >+</script> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body id="body"> >+ >+<a id="link" href="#">focusable link</a> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ >+ description("This tests the relative frame attribute returns accurate data."); >+ >+ if (window.accessibilityController) { >+ >+ var link = accessibilityController.accessibleElementById("link"); >+ debug("position: " + link.stringDescriptionOfAttributeValue("AXPosition")); >+ debug("relative frame: " + link.stringDescriptionOfAttributeValue("AXRelativeFrame")); >+ } >+ >+ successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/platform/mac-wk1/TestExpectations >=================================================================== >--- LayoutTests/platform/mac-wk1/TestExpectations (revision 239843) >+++ LayoutTests/platform/mac-wk1/TestExpectations (working copy) >@@ -537,6 +537,7 @@ > webkit.org/b/184742 accessibility/mac/async-increment-decrement-action.html [ Skip ] > webkit.org/b/185897 accessibility/mac/AOM-event-accessiblesetvalue.html [ Skip ] > webkit.org/b/185897 accessibility/mac/set-value-editable-types.html [ Skip ] >+webkit.org/b/193414 accessibility/mac/relative-frame.html [ Skip ] > > webkit.org/b/182752 accessibility/mac/accessibility-make-first-responder.html [ Skip ] > >@@ -665,4 +666,4 @@ > > webkit.org/b/191639 imported/blink/compositing/squashing/squashing-into-ancestor-painted-layer.html [ Pass ImageOnlyFailure ] > >-webkit.org/b/190627 [ Mojave+ ] compositing/masks/compositing-clip-path-change-no-repaint.html [ Pass Failure ] >\ No newline at end of file >+webkit.org/b/190627 [ Mojave+ ] compositing/masks/compositing-clip-path-change-no-repaint.html [ Pass Failure ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193414
:
359097
|
359104
|
359106
|
359117
|
359134
|
359275
|
359276
|
359335
|
359405
|
359408
|
359421
|
359423
|
359434
|
359435
|
359636
|
359651
|
359656