Skip to content

Commit

Permalink
fix: Add ContentsView to AXChildren (#23174)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
  • Loading branch information
trop[bot] and felixrieseberg committed Apr 20, 2020
1 parent 6535764 commit f45e2d2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion shell/browser/ui/cocoa/atom_ns_window.mm
Expand Up @@ -120,7 +120,18 @@ - (id)accessibilityAttributeValue:(NSString*)attribute {
[NSButtonCell class], @"RenderWidgetHostViewCocoa"];

NSArray* children = [super accessibilityAttributeValue:attribute];
return [children filteredArrayUsingPredicate:predicate];
NSMutableArray* mutableChildren = [[children mutableCopy] autorelease];
[mutableChildren filterUsingPredicate:predicate];

// We need to add the web contents: Without us doing so, VoiceOver
// users will be able to navigate up the a11y tree, but not back down.
// The content view contains the "web contents", which VoiceOver
// immediately understands.
NSView* contentView =
[shell_->GetNativeWindow().GetNativeNSWindow() contentView];
[mutableChildren addObject:contentView];

return mutableChildren;
}

- (NSString*)accessibilityTitle {
Expand Down

0 comments on commit f45e2d2

Please sign in to comment.