fix: Add ContentsView to AXChildren (#22469)

Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
This commit is contained in:
trop[bot]
2020-03-02 16:28:38 +09:00
committed by GitHub
parent 3e90e523eb
commit 5e25649e77

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 {