Skip to content

Commit f45e2d2

Browse files
fix: Add ContentsView to AXChildren (electron#23174)
Co-authored-by: Felix Rieseberg <felix@felixrieseberg.com>
1 parent 6535764 commit f45e2d2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

shell/browser/ui/cocoa/atom_ns_window.mm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,18 @@ - (id)accessibilityAttributeValue:(NSString*)attribute {
120120
[NSButtonCell class], @"RenderWidgetHostViewCocoa"];
121121

122122
NSArray* children = [super accessibilityAttributeValue:attribute];
123-
return [children filteredArrayUsingPredicate:predicate];
123+
NSMutableArray* mutableChildren = [[children mutableCopy] autorelease];
124+
[mutableChildren filterUsingPredicate:predicate];
125+
126+
// We need to add the web contents: Without us doing so, VoiceOver
127+
// users will be able to navigate up the a11y tree, but not back down.
128+
// The content view contains the "web contents", which VoiceOver
129+
// immediately understands.
130+
NSView* contentView =
131+
[shell_->GetNativeWindow().GetNativeNSWindow() contentView];
132+
[mutableChildren addObject:contentView];
133+
134+
return mutableChildren;
124135
}
125136

126137
- (NSString*)accessibilityTitle {

0 commit comments

Comments
 (0)