diff --git a/accessible/src/mac/mozActionElements.mm b/accessible/src/mac/mozActionElements.mm index f22cc992f9f0..f673d8c82107 100644 --- a/accessible/src/mac/mozActionElements.mm +++ b/accessible/src/mac/mozActionElements.mm @@ -338,6 +338,19 @@ enum CheckboxValue { @implementation mozPaneAccessible +- (NSUInteger)accessibilityArrayAttributeCount:(NSString*)attribute +{ + if (!mGeckoAccessible) + return 0; + + // By default this calls -[[mozAccessible children] count]. + // Since we don't cache mChildren. This is faster. + if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) + return mGeckoAccessible->ChildCount() ? 1 : 0; + + return [super accessibilityArrayAttributeCount:attribute]; +} + - (NSArray*)children { if (!mGeckoAccessible)