| Index: ui/accessibility/platform/ax_platform_node_mac.mm
|
| diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm
|
| index 2b09d34d70eab2b78d19fb0bffa5eba1d8576ac4..2eb4dba0a3ac50dff8940613b19157feedcb0654 100644
|
| --- a/ui/accessibility/platform/ax_platform_node_mac.mm
|
| +++ b/ui/accessibility/platform/ax_platform_node_mac.mm
|
| @@ -311,9 +311,6 @@
|
| // NSAccessibility informal protocol implementation.
|
|
|
| - (BOOL)accessibilityIsIgnored {
|
| - if (!node_)
|
| - return YES;
|
| -
|
| return [[self AXRole] isEqualToString:NSAccessibilityUnknownRole] ||
|
| node_->GetData().HasState(ui::AX_STATE_INVISIBLE);
|
| }
|
| @@ -333,13 +330,10 @@
|
| }
|
|
|
| - (id)accessibilityFocusedUIElement {
|
| - return node_ ? node_->GetDelegate()->GetFocus() : nil;
|
| + return node_->GetDelegate()->GetFocus();
|
| }
|
|
|
| - (NSArray*)accessibilityActionNames {
|
| - if (!node_)
|
| - return @[];
|
| -
|
| base::scoped_nsobject<NSMutableArray> axActions(
|
| [[NSMutableArray alloc] init]);
|
|
|
| @@ -361,11 +355,7 @@
|
| }
|
|
|
| - (void)accessibilityPerformAction:(NSString*)action {
|
| - // Actions are performed asynchronously, so it's always possible for an object
|
| - // to change its mind after previously reporting an action as available.
|
| - if (![[self accessibilityActionNames] containsObject:action])
|
| - return;
|
| -
|
| + DCHECK([[self accessibilityActionNames] containsObject:action]);
|
| ui::AXActionData data;
|
| if ([action isEqualToString:NSAccessibilityShowMenuAction] &&
|
| AlsoUseShowMenuActionForDefaultAction(node_->GetData())) {
|
| @@ -388,9 +378,6 @@
|
| }
|
|
|
| - (NSArray*)accessibilityAttributeNames {
|
| - if (!node_)
|
| - return @[];
|
| -
|
| // These attributes are required on all accessibility objects.
|
| NSArray* const kAllRoleAttributes = @[
|
| NSAccessibilityChildrenAttribute,
|
| @@ -460,7 +447,7 @@
|
|
|
| - (NSArray*)accessibilityParameterizedAttributeNames {
|
| if (!node_)
|
| - return @[];
|
| + return nil;
|
|
|
| static NSArray* const kSelectableTextAttributes = [@[
|
| NSAccessibilityLineForIndexParameterizedAttribute,
|
| @@ -485,9 +472,6 @@
|
| }
|
|
|
| - (BOOL)accessibilityIsAttributeSettable:(NSString*)attributeName {
|
| - if (!node_)
|
| - return NO;
|
| -
|
| if (node_->GetData().HasState(ui::AX_STATE_DISABLED))
|
| return NO;
|
|
|
| @@ -525,9 +509,6 @@
|
| }
|
|
|
| - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
|
| - if (!node_)
|
| - return;
|
| -
|
| ui::AXActionData data;
|
|
|
| // Check for attributes first. Only the |data.action| should be set here - any
|
| @@ -566,9 +547,6 @@
|
| }
|
|
|
| - (id)accessibilityAttributeValue:(NSString*)attribute {
|
| - if (!node_)
|
| - return nil; // Return nil when detached. Even for AXRole.
|
| -
|
| SEL selector = NSSelectorFromString(attribute);
|
| if ([self respondsToSelector:selector])
|
| return [self performSelector:selector];
|
| @@ -577,9 +555,6 @@
|
|
|
| - (id)accessibilityAttributeValue:(NSString*)attribute
|
| forParameter:(id)parameter {
|
| - if (!node_)
|
| - return nil;
|
| -
|
| SEL selector = NSSelectorFromString([attribute stringByAppendingString:@":"]);
|
| if ([self respondsToSelector:selector])
|
| return [self performSelector:selector withObject:parameter];
|
| @@ -592,7 +567,6 @@
|
| - (NSString*)AXRole {
|
| if (!node_)
|
| return nil;
|
| -
|
| return [[self class] nativeRoleFromAXRole:node_->GetData().role];
|
| }
|
|
|
| @@ -660,8 +634,7 @@
|
|
|
| - (NSArray*)AXChildren {
|
| if (!node_)
|
| - return @[];
|
| -
|
| + return nil;
|
| int count = node_->GetChildCount();
|
| NSMutableArray* children = [NSMutableArray arrayWithCapacity:count];
|
| for (int i = 0; i < count; ++i)
|
|
|