fix: Add ContentsView to AXChildren (#22399)

This commit is contained in:
Felix Rieseberg 2020-03-01 18:25:40 -08:00 committed by GitHub
parent 4c6150ea3d
commit cad7054e4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,7 +121,18 @@ bool ScopedDisableResize::disable_resize_ = false;
[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 {