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

Side by Side Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 742783008: AXRequired should be exposed only when aria-required="true" or required attribute is present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing nit 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/test/data/accessibility/aria-required-expected-mac.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <execinfo.h> 5 #include <execinfo.h>
6 6
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 NSAccessibilityRoleAttribute, 1208 NSAccessibilityRoleAttribute,
1209 NSAccessibilityRoleDescriptionAttribute, 1209 NSAccessibilityRoleDescriptionAttribute,
1210 NSAccessibilitySizeAttribute, 1210 NSAccessibilitySizeAttribute,
1211 NSAccessibilitySubroleAttribute, 1211 NSAccessibilitySubroleAttribute,
1212 NSAccessibilityTitleAttribute, 1212 NSAccessibilityTitleAttribute,
1213 NSAccessibilityTopLevelUIElementAttribute, 1213 NSAccessibilityTopLevelUIElementAttribute,
1214 NSAccessibilityValueAttribute, 1214 NSAccessibilityValueAttribute,
1215 NSAccessibilityWindowAttribute, 1215 NSAccessibilityWindowAttribute,
1216 @"AXAccessKey", 1216 @"AXAccessKey",
1217 @"AXInvalid", 1217 @"AXInvalid",
1218 @"AXRequired",
1219 @"AXVisited", 1218 @"AXVisited",
1220 nil]; 1219 nil];
1221 1220
1222 // Specific role attributes. 1221 // Specific role attributes.
1223 NSString* role = [self role]; 1222 NSString* role = [self role];
1224 NSString* subrole = [self subrole]; 1223 NSString* subrole = [self subrole];
1225 if ([role isEqualToString:NSAccessibilityTableRole] || 1224 if ([role isEqualToString:NSAccessibilityTableRole] ||
1226 [role isEqualToString:NSAccessibilityGridRole]) { 1225 [role isEqualToString:NSAccessibilityGridRole]) {
1227 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1226 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1228 NSAccessibilityColumnsAttribute, 1227 NSAccessibilityColumnsAttribute,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 NSAccessibilityExpandedAttribute, 1343 NSAccessibilityExpandedAttribute,
1345 nil]]; 1344 nil]];
1346 } 1345 }
1347 1346
1348 if (GetState(browserAccessibility_, ui::AX_STATE_VERTICAL) 1347 if (GetState(browserAccessibility_, ui::AX_STATE_VERTICAL)
1349 || GetState(browserAccessibility_, ui::AX_STATE_HORIZONTAL)) { 1348 || GetState(browserAccessibility_, ui::AX_STATE_HORIZONTAL)) {
1350 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1349 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1351 NSAccessibilityOrientationAttribute, nil]]; 1350 NSAccessibilityOrientationAttribute, nil]];
1352 } 1351 }
1353 1352
1353 if (GetState(browserAccessibility_, ui::AX_STATE_REQUIRED)) {
1354 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1355 @"AXRequired", nil]];
1356 }
1357
1354 // Title UI Element. 1358 // Title UI Element.
1355 if (browserAccessibility_->HasIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT) || 1359 if (browserAccessibility_->HasIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT) ||
1356 (browserAccessibility_->HasIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) && 1360 (browserAccessibility_->HasIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) &&
1357 browserAccessibility_->GetIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) 1361 browserAccessibility_->GetIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS)
1358 .size() == 1)) { 1362 .size() == 1)) {
1359 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1363 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1360 NSAccessibilityTitleUIElementAttribute, 1364 NSAccessibilityTitleUIElementAttribute,
1361 nil]]; 1365 nil]];
1362 } 1366 }
1363 // TODO(aboxhall): expose NSAccessibilityServesAsTitleForUIElementsAttribute 1367 // TODO(aboxhall): expose NSAccessibilityServesAsTitleForUIElementsAttribute
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 return [super hash]; 1510 return [super hash];
1507 return browserAccessibility_->GetId(); 1511 return browserAccessibility_->GetId();
1508 } 1512 }
1509 1513
1510 - (BOOL)accessibilityShouldUseUniqueId { 1514 - (BOOL)accessibilityShouldUseUniqueId {
1511 return YES; 1515 return YES;
1512 } 1516 }
1513 1517
1514 @end 1518 @end
1515 1519
OLDNEW
« no previous file with comments | « no previous file | content/test/data/accessibility/aria-required-expected-mac.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698