зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635517 - Update deprecated accessibilityIsIgnored to isAccessibilityElement. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D74431
This commit is contained in:
Родитель
d9362e620b
Коммит
567a8af15c
|
@ -153,9 +153,8 @@ static const uintptr_t IS_PROXY = 1;
|
||||||
|
|
||||||
// ---- NSAccessibility methods ---- //
|
// ---- NSAccessibility methods ---- //
|
||||||
|
|
||||||
// whether to skip this element when traversing the accessibility
|
// whether to include this element in the platform's tree
|
||||||
// hierarchy.
|
- (BOOL)isAccessibilityElement;
|
||||||
- (BOOL)accessibilityIsIgnored;
|
|
||||||
|
|
||||||
// called by third-parties to determine the deepest child element under the mouse
|
// called by third-parties to determine the deepest child element under the mouse
|
||||||
- (id)accessibilityHitTest:(NSPoint)point;
|
- (id)accessibilityHitTest:(NSPoint)point;
|
||||||
|
|
|
@ -131,14 +131,10 @@ static inline NSMutableArray* ConvertToNSArray(nsTArray<ProxyAccessible*>& aArra
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
- (BOOL)accessibilityIsIgnored {
|
- (BOOL)isAccessibilityElement {
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||||
|
|
||||||
// unknown (either unimplemented, or irrelevant) elements are marked as ignored
|
return YES;
|
||||||
// as well as expired elements.
|
|
||||||
|
|
||||||
return [[self role] isEqualToString:NSAccessibilityUnknownRole] &&
|
|
||||||
[self stateWithMask:states::FOCUSABLE];
|
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
// returns the accessible at the specified point.
|
// returns the accessible at the specified point.
|
||||||
- (id)accessibilityHitTest:(NSPoint)point;
|
- (id)accessibilityHitTest:(NSPoint)point;
|
||||||
|
|
||||||
// whether this element is flagged as ignored.
|
// whether this element should be exposed to platform.
|
||||||
- (BOOL)accessibilityIsIgnored;
|
- (BOOL)isAccessibilityElement;
|
||||||
|
|
||||||
// currently focused UI element (possibly a child accessible)
|
// currently focused UI element (possibly a child accessible)
|
||||||
- (id)accessibilityFocusedUIElement;
|
- (id)accessibilityFocusedUIElement;
|
||||||
|
|
|
@ -80,10 +80,6 @@ enum CheckboxValue {
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)accessibilityIsIgnored {
|
|
||||||
return ![self getGeckoAccessible] && ![self getProxyAccessible];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)hasPopup {
|
- (BOOL)hasPopup {
|
||||||
return ([self stateWithMask:states::HASPOPUP] != 0);
|
return ([self stateWithMask:states::HASPOPUP] != 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
- (NSString*)accessibilityRoleDescription;
|
- (NSString*)accessibilityRoleDescription;
|
||||||
- (mozAccessible*)accessibilityParent;
|
- (mozAccessible*)accessibilityParent;
|
||||||
- (NSArray*)accessibilityChildren;
|
- (NSArray*)accessibilityChildren;
|
||||||
- (BOOL)accessibilityIsIgnored;
|
- (BOOL)isAccessibilityElement;
|
||||||
- (void)invalidateChildren;
|
- (void)invalidateChildren;
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
- (void)expire;
|
- (void)expire;
|
||||||
|
|
|
@ -66,8 +66,8 @@
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)accessibilityIsIgnored {
|
- (BOOL)isAccessibilityElement {
|
||||||
return NO;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)invalidateChildren {
|
- (void)invalidateChildren {
|
||||||
|
|
|
@ -49,10 +49,6 @@ inline NSString* ToNSString(id aValue) {
|
||||||
|
|
||||||
@implementation mozTextAccessible
|
@implementation mozTextAccessible
|
||||||
|
|
||||||
- (BOOL)accessibilityIsIgnored {
|
|
||||||
return ![self getGeckoAccessible] && ![self getProxyAccessible];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSArray*)accessibilityAttributeNames {
|
- (NSArray*)accessibilityAttributeNames {
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
|
|
|
@ -341,8 +341,8 @@ nsresult xpcAccessibleMacInterface::NSObjectToJsValue(id aObj, JSContext* aCx,
|
||||||
return NSObjectToJsValue(
|
return NSObjectToJsValue(
|
||||||
@[ [NSNumber numberWithDouble:size.width], [NSNumber numberWithDouble:size.height] ], aCx,
|
@[ [NSNumber numberWithDouble:size.width], [NSNumber numberWithDouble:size.height] ], aCx,
|
||||||
aResult);
|
aResult);
|
||||||
} else if ([aObj respondsToSelector:@selector(accessibilityIsIgnored)]) {
|
} else if ([aObj respondsToSelector:@selector(isAccessibilityElement)]) {
|
||||||
// We expect all of our accessibility objects to implement accessibilityIsIgnored
|
// 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.
|
// at the very least. If it is implemented we will assume its an accessibility object.
|
||||||
nsCOMPtr<nsIAccessibleMacInterface> obj = new xpcAccessibleMacInterface(aObj);
|
nsCOMPtr<nsIAccessibleMacInterface> obj = new xpcAccessibleMacInterface(aObj);
|
||||||
return nsContentUtils::WrapNative(aCx, obj, &NS_GET_IID(nsIAccessibleMacInterface), aResult);
|
return nsContentUtils::WrapNative(aCx, obj, &NS_GET_IID(nsIAccessibleMacInterface), aResult);
|
||||||
|
|
|
@ -4977,10 +4977,10 @@ nsresult nsChildView::GetSelectionAsPlaintext(nsAString& aResult) {
|
||||||
|
|
||||||
// general
|
// general
|
||||||
|
|
||||||
- (BOOL)accessibilityIsIgnored {
|
- (BOOL)isAccessibilityElement {
|
||||||
if (!mozilla::a11y::ShouldA11yBeEnabled()) return [super accessibilityIsIgnored];
|
if (!mozilla::a11y::ShouldA11yBeEnabled()) return [super isAccessibilityElement];
|
||||||
|
|
||||||
return [[self accessible] accessibilityIsIgnored];
|
return [[self accessible] isAccessibilityElement];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)accessibilityHitTest:(NSPoint)point {
|
- (id)accessibilityHitTest:(NSPoint)point {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче