Bug 1635517 - Update deprecated accessibilityIsIgnored to isAccessibilityElement. r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D74431
This commit is contained in:
Eitan Isaacson 2020-05-12 17:39:18 +00:00
Родитель d9362e620b
Коммит 567a8af15c
9 изменённых файлов: 14 добавлений и 27 удалений

Просмотреть файл

@ -153,9 +153,8 @@ static const uintptr_t IS_PROXY = 1;
// ---- NSAccessibility methods ---- //
// whether to skip this element when traversing the accessibility
// hierarchy.
- (BOOL)accessibilityIsIgnored;
// whether to include this element in the platform's tree
- (BOOL)isAccessibilityElement;
// called by third-parties to determine the deepest child element under the mouse
- (id)accessibilityHitTest:(NSPoint)point;

Просмотреть файл

@ -131,14 +131,10 @@ static inline NSMutableArray* ConvertToNSArray(nsTArray<ProxyAccessible*>& aArra
#pragma mark -
- (BOOL)accessibilityIsIgnored {
- (BOOL)isAccessibilityElement {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
// unknown (either unimplemented, or irrelevant) elements are marked as ignored
// as well as expired elements.
return [[self role] isEqualToString:NSAccessibilityUnknownRole] &&
[self stateWithMask:states::FOCUSABLE];
return YES;
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
}

Просмотреть файл

@ -42,8 +42,8 @@
// returns the accessible at the specified point.
- (id)accessibilityHitTest:(NSPoint)point;
// whether this element is flagged as ignored.
- (BOOL)accessibilityIsIgnored;
// whether this element should be exposed to platform.
- (BOOL)isAccessibilityElement;
// currently focused UI element (possibly a child accessible)
- (id)accessibilityFocusedUIElement;

Просмотреть файл

@ -80,10 +80,6 @@ enum CheckboxValue {
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
- (BOOL)accessibilityIsIgnored {
return ![self getGeckoAccessible] && ![self getProxyAccessible];
}
- (BOOL)hasPopup {
return ([self stateWithMask:states::HASPOPUP] != 0);
}

Просмотреть файл

@ -18,7 +18,7 @@
- (NSString*)accessibilityRoleDescription;
- (mozAccessible*)accessibilityParent;
- (NSArray*)accessibilityChildren;
- (BOOL)accessibilityIsIgnored;
- (BOOL)isAccessibilityElement;
- (void)invalidateChildren;
- (void)dealloc;
- (void)expire;

Просмотреть файл

@ -66,8 +66,8 @@
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
- (BOOL)accessibilityIsIgnored {
return NO;
- (BOOL)isAccessibilityElement {
return YES;
}
- (void)invalidateChildren {

Просмотреть файл

@ -49,10 +49,6 @@ inline NSString* ToNSString(id aValue) {
@implementation mozTextAccessible
- (BOOL)accessibilityIsIgnored {
return ![self getGeckoAccessible] && ![self getProxyAccessible];
}
- (NSArray*)accessibilityAttributeNames {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;

Просмотреть файл

@ -341,8 +341,8 @@ nsresult xpcAccessibleMacInterface::NSObjectToJsValue(id aObj, JSContext* aCx,
return NSObjectToJsValue(
@[ [NSNumber numberWithDouble:size.width], [NSNumber numberWithDouble:size.height] ], aCx,
aResult);
} else if ([aObj respondsToSelector:@selector(accessibilityIsIgnored)]) {
// We expect all of our accessibility objects to implement accessibilityIsIgnored
} else if ([aObj respondsToSelector:@selector(isAccessibilityElement)]) {
// We expect all of our accessibility objects to implement isAccessibilityElement
// at the very least. If it is implemented we will assume its an accessibility object.
nsCOMPtr<nsIAccessibleMacInterface> obj = new xpcAccessibleMacInterface(aObj);
return nsContentUtils::WrapNative(aCx, obj, &NS_GET_IID(nsIAccessibleMacInterface), aResult);

Просмотреть файл

@ -4977,10 +4977,10 @@ nsresult nsChildView::GetSelectionAsPlaintext(nsAString& aResult) {
// general
- (BOOL)accessibilityIsIgnored {
if (!mozilla::a11y::ShouldA11yBeEnabled()) return [super accessibilityIsIgnored];
- (BOOL)isAccessibilityElement {
if (!mozilla::a11y::ShouldA11yBeEnabled()) return [super isAccessibilityElement];
return [[self accessible] accessibilityIsIgnored];
return [[self accessible] isAccessibilityElement];
}
- (id)accessibilityHitTest:(NSPoint)point {