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

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

Issue 744623002: Exposing ARIA state/property aria-orientation on Windows correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing presubmit warning Created 6 years 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 33a95c4b6dd33dbca8076ac5e76e9dceab2ca08e..bb3e2b5245171535fce7dbe98ae5c222e7b4adea 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -446,20 +446,12 @@ NSDictionary* attributeToMethodNameMap = nil;
}
- (NSString*)orientation {
- // We present a spin button as a vertical slider, with a role description
- // of "spin button".
- if ([self internalRole] == ui::AX_ROLE_SPIN_BUTTON)
- return NSAccessibilityVerticalOrientationValue;
-
- if ([self internalRole] == ui::AX_ROLE_LIST ||
- [self internalRole] == ui::AX_ROLE_LIST_BOX) {
- return NSAccessibilityVerticalOrientationValue;
- }
-
if (GetState(browserAccessibility_, ui::AX_STATE_VERTICAL))
return NSAccessibilityVerticalOrientationValue;
- else
+ else if (GetState(browserAccessibility_, ui::AX_STATE_HORIZONTAL))
return NSAccessibilityHorizontalOrientationValue;
+
+ return @"";
}
- (NSNumber*)numberOfCharacters {
@@ -1277,7 +1269,6 @@ NSDictionary* attributeToMethodNameMap = nil;
[ret addObjectsFromArray:[NSArray arrayWithObjects:
NSAccessibilityMaxValueAttribute,
NSAccessibilityMinValueAttribute,
- NSAccessibilityOrientationAttribute,
NSAccessibilityValueDescriptionAttribute,
nil]];
} else if ([subrole isEqualToString:NSAccessibilityOutlineRowSubrole]) {
@@ -1308,7 +1299,6 @@ NSDictionary* attributeToMethodNameMap = nil;
}
} else if ([role isEqualToString:NSAccessibilityListRole]) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
- NSAccessibilityOrientationAttribute,
NSAccessibilitySelectedChildrenAttribute,
NSAccessibilityVisibleChildrenAttribute,
nil]];
@@ -1355,6 +1345,12 @@ NSDictionary* attributeToMethodNameMap = nil;
nil]];
}
+ if (GetState(browserAccessibility_, ui::AX_STATE_VERTICAL)
+ || GetState(browserAccessibility_, ui::AX_STATE_HORIZONTAL)) {
+ [ret addObjectsFromArray:[NSArray arrayWithObjects:
+ NSAccessibilityOrientationAttribute, nil]];
+ }
+
// Title UI Element.
if (browserAccessibility_->HasIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT) ||
(browserAccessibility_->HasIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) &&

Powered by Google App Engine
This is Rietveld 408576698