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

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

Issue 736023002: Add conversion rule for aria-grabbed attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Comment 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 b6f58df044fc51f8c58a13dc56c6b2e67b010dd8..b09e4d6b5d81bef64cac70da14030ec94443ba73 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -109,6 +109,7 @@ NSDictionary* attributeToMethodNameMap = nil;
{ @"AXARIABusy", @"ariaBusy" },
{ @"AXARIALive", @"ariaLive" },
{ @"AXARIARelevant", @"ariaRelevant" },
+ { @"AXGrabbed", @"grabbed" },
{ @"AXInvalid", @"invalid" },
{ @"AXLoaded", @"loaded" },
{ @"AXLoadingProgress", @"loadingProgress" },
@@ -343,6 +344,11 @@ NSDictionary* attributeToMethodNameMap = nil;
return ret;
}
+- (NSNumber*)grabbed {
+ bool boolValue = browserAccessibility_->GetBoolAttribute(ui::AX_ATTR_GRABBED);
+ return [NSNumber numberWithBool:boolValue];
+}
+
- (id)header {
int headerElementId = -1;
if ([self internalRole] == ui::AX_ROLE_TABLE ||
@@ -1386,8 +1392,14 @@ NSDictionary* attributeToMethodNameMap = nil;
@"AXARIABusy",
nil]];
}
+ // Add aria-grabbed attribute only if it has true.
+ if (browserAccessibility_->HasBoolAttribute(ui::AX_ATTR_GRABBED)) {
+ [ret addObjectsFromArray:[NSArray arrayWithObjects:
+ @"AXGrabbed",
+ nil]];
+ }
- //Add expanded attribute only if it has expanded or collapsed state.
+ // Add expanded attribute only if it has expanded or collapsed state.
if (GetState(browserAccessibility_, ui::AX_STATE_EXPANDED) ||
GetState(browserAccessibility_, ui::AX_STATE_COLLAPSED)) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:

Powered by Google App Engine
This is Rietveld 408576698