Chromium Code Reviews| Index: ui/accessibility/platform/ax_platform_node_mac.mm |
| diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm |
| index 5bfa69c675fa5c1124ea5fcf8954307ef461170f..05975e6a78eca425d69c055ef4262947297271bb 100644 |
| --- a/ui/accessibility/platform/ax_platform_node_mac.mm |
| +++ b/ui/accessibility/platform/ax_platform_node_mac.mm |
| @@ -376,12 +376,15 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { |
| if ([attributeName |
| isEqualToString:NSAccessibilitySelectedChildrenAttribute] || |
| [attributeName |
| - isEqualToString:NSAccessibilitySelectedTextRangeAttribute] || |
| - [attributeName |
| isEqualToString:NSAccessibilityVisibleCharacterRangeAttribute]) { |
| return NO; |
| } |
| + if ([attributeName |
| + isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) { |
| + return YES; |
| + } |
| + |
| // Since tabs use the Radio Button role on Mac, the standard way to set them |
| // is via the value attribute rather than the selected attribute. |
| if ([attributeName isEqualToString:NSAccessibilityValueAttribute] && |
| @@ -416,6 +419,9 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { |
| : ui::AX_ACTION_SET_VALUE; |
| } else if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute]) { |
| data.action = ui::AX_ACTION_REPLACE_SELECTED_TEXT; |
| + } else if ([attribute |
| + isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) { |
| + data.action = ui::AX_ACTION_SET_SELECTION; |
| } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { |
| if ([value isKindOfClass:[NSNumber class]]) { |
| data.action = |
| @@ -424,8 +430,13 @@ void NotifyMacEvent(AXPlatformNodeCocoa* target, ui::AXEvent event_type) { |
| } |
| // Set type-specific information as necessary for actions set above. |
| - if ([value isKindOfClass:[NSString class]]) |
| + if ([value isKindOfClass:[NSString class]]) { |
| data.value = base::SysNSStringToUTF16(value); |
| + } else if ([value isKindOfClass:[NSValue class]]) { |
| + NSRange range = [value rangeValue]; |
|
tapted
2017/02/09 23:09:37
I think we should only do this if data.action == u
Patti Lor
2017/02/13 23:31:03
Done, thanks :)
|
| + data.anchor_offset = range.location; |
| + data.focus_offset = range.location + range.length; |
| + } |
| if (data.action != ui::AX_ACTION_NONE) |
| node_->GetDelegate()->AccessibilityPerformAction(data); |