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

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

Issue 825613002: Expose html placeholder attribute as AXPlaceholder: <value> on MAC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 92515d542894d31b8b2baa16a18ff8c17eb9871f..a40761c2df72b09a7093c3f4e3c83e5235dbfb06 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -111,6 +111,7 @@ NSDictionary* attributeToMethodNameMap = nil;
{ @"AXInvalid", @"invalid" },
{ @"AXLoaded", @"loaded" },
{ @"AXLoadingProgress", @"loadingProgress" },
+ { @"AXPlaceholder", @"placeholder" },
{ @"AXRequired", @"required" },
{ @"AXVisited", @"visited" },
};
@@ -401,6 +402,11 @@ NSDictionary* attributeToMethodNameMap = nil;
return invalid;
}
+- (NSString*)placeholder {
+ return NSStringForStringAttribute(
+ browserAccessibility_, ui::AX_ATTR_PLACEHOLDER);
+}
+
- (void)addLinkedUIElementsFromAttribute:(ui::AXIntListAttribute)attribute
addTo:(NSMutableArray*)outArray {
const std::vector<int32>& attributeValues =
@@ -1358,6 +1364,11 @@ NSDictionary* attributeToMethodNameMap = nil;
NSAccessibilityOrientationAttribute, nil]];
}
+ if (browserAccessibility_->HasStringAttribute(ui::AX_ATTR_PLACEHOLDER)) {
+ [ret addObjectsFromArray:[NSArray arrayWithObjects:
+ @"AXPlaceholder", nil]];
+ }
+
if (GetState(browserAccessibility_, ui::AX_STATE_REQUIRED)) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
@"AXRequired", nil]];

Powered by Google App Engine
This is Rietveld 408576698