Use children's labels if element doesn't have one (#3709)

Android seems to do this by default. This way, if you select a table cell it will read the content of that cell.
This commit is contained in:
Michael Goderbauer
2017-05-23 14:50:26 -07:00
committed by GitHub
parent 69b75b5810
commit 6187779e9c
@@ -96,7 +96,12 @@ blink::SemanticsAction GetSemanticsActionForScrollDirection(
- (NSString*)accessibilityLabel {
if (_node.label.empty()) {
return nil;
NSMutableString *label = [NSMutableString string];
for (auto& child : _children) {
[label appendString: [child accessibilityLabel]];
[label appendString: @"\n"];
}
return label;
}
return @(_node.label.data());
}