Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 1046883002: Use multiline attribute to check for IA2_STATE_MULTILINE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing textarea Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_cocoa.mm
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 9781913557fe81c12b348564a5b04615cdbf4cb2..7db4fc7fa29617bcb18363849b9908c754bcd916 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -582,6 +582,10 @@ NSDictionary* attributeToMethodNameMap = nil;
else
return NSAccessibilityButtonRole;
}
+ if (role == ui::AX_ROLE_TEXT_FIELD &&
+ browserAccessibility_->HasState(ui::AX_STATE_MULTILINE)) {
+ return NSAccessibilityTextAreaRole;
+ }
// If this is a web area for a presentational iframe, give it a role of
// something other than WebArea so that the fact that it's a separate doc
@@ -1209,8 +1213,7 @@ NSDictionary* attributeToMethodNameMap = nil;
NSAccessibilityCellForColumnAndRowParameterizedAttribute,
nil];
}
- if ([[self role] isEqualToString:NSAccessibilityTextFieldRole] ||
- [[self role] isEqualToString:NSAccessibilityTextAreaRole]) {
+ if ([[self role] isEqualToString:NSAccessibilityTextFieldRole]) {
return [NSArray arrayWithObjects:
NSAccessibilityLineForIndexParameterizedAttribute,
NSAccessibilityRangeForLineParameterizedAttribute,
@@ -1241,7 +1244,6 @@ NSDictionary* attributeToMethodNameMap = nil;
NSString* role = [self role];
// TODO(dtseng): this should only get set when there's a default action.
if (![role isEqualToString:NSAccessibilityStaticTextRole] &&
- ![role isEqualToString:NSAccessibilityTextAreaRole] &&
![role isEqualToString:NSAccessibilityTextFieldRole]) {
[ret addObject:NSAccessibilityPressAction];
}
@@ -1346,8 +1348,7 @@ NSDictionary* attributeToMethodNameMap = nil;
@"AXLoaded",
@"AXLoadingProgress",
nil]];
- } else if ([role isEqualToString:NSAccessibilityTextFieldRole] ||
- [role isEqualToString:NSAccessibilityTextAreaRole]) {
+ } else if ([role isEqualToString:NSAccessibilityTextFieldRole]) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
NSAccessibilityInsertionPointLineNumberAttribute,
NSAccessibilityNumberOfCharactersAttribute,
@@ -1513,8 +1514,7 @@ NSDictionary* attributeToMethodNameMap = nil;
ui::AX_ATTR_CAN_SET_VALUE);
}
if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute] &&
- ([[self role] isEqualToString:NSAccessibilityTextFieldRole] ||
- [[self role] isEqualToString:NSAccessibilityTextAreaRole]))
+ ([[self role] isEqualToString:NSAccessibilityTextFieldRole]))
return YES;
return NO;

Powered by Google App Engine
This is Rietveld 408576698