| OLD | NEW |
| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 int id = uniqueCellIds[i]; | 226 int id = uniqueCellIds[i]; |
| 227 BrowserAccessibility* cell = | 227 BrowserAccessibility* cell = |
| 228 browserAccessibility_->manager()->GetFromID(id); | 228 browserAccessibility_->manager()->GetFromID(id); |
| 229 if (cell && cell->GetRole() == ui::AX_ROLE_COLUMN_HEADER) | 229 if (cell && cell->GetRole() == ui::AX_ROLE_COLUMN_HEADER) |
| 230 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; | 230 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; |
| 231 } | 231 } |
| 232 return ret; | 232 return ret; |
| 233 } | 233 } |
| 234 | 234 |
| 235 - (NSValue*)columnIndexRange { | 235 - (NSValue*)columnIndexRange { |
| 236 if ([self internalRole] != ui::AX_ROLE_CELL) | 236 if (!browserAccessibility_->IsCellOrTableHeaderRole()) |
| 237 return nil; | 237 return nil; |
| 238 | 238 |
| 239 int column = -1; | 239 int column = -1; |
| 240 int colspan = -1; | 240 int colspan = -1; |
| 241 browserAccessibility_->GetIntAttribute( | 241 browserAccessibility_->GetIntAttribute( |
| 242 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, &column); | 242 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, &column); |
| 243 browserAccessibility_->GetIntAttribute( | 243 browserAccessibility_->GetIntAttribute( |
| 244 ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, &colspan); | 244 ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, &colspan); |
| 245 if (column >= 0 && colspan >= 1) | 245 if (column >= 0 && colspan >= 1) |
| 246 return [NSValue valueWithRange:NSMakeRange(column, colspan)]; | 246 return [NSValue valueWithRange:NSMakeRange(column, colspan)]; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 int id = uniqueCellIds[i]; | 659 int id = uniqueCellIds[i]; |
| 660 BrowserAccessibility* cell = | 660 BrowserAccessibility* cell = |
| 661 browserAccessibility_->manager()->GetFromID(id); | 661 browserAccessibility_->manager()->GetFromID(id); |
| 662 if (cell && cell->GetRole() == ui::AX_ROLE_ROW_HEADER) | 662 if (cell && cell->GetRole() == ui::AX_ROLE_ROW_HEADER) |
| 663 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; | 663 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; |
| 664 } | 664 } |
| 665 return ret; | 665 return ret; |
| 666 } | 666 } |
| 667 | 667 |
| 668 - (NSValue*)rowIndexRange { | 668 - (NSValue*)rowIndexRange { |
| 669 if ([self internalRole] != ui::AX_ROLE_CELL) | 669 if (!browserAccessibility_->IsCellOrTableHeaderRole()) |
| 670 return nil; | 670 return nil; |
| 671 | 671 |
| 672 int row = -1; | 672 int row = -1; |
| 673 int rowspan = -1; | 673 int rowspan = -1; |
| 674 browserAccessibility_->GetIntAttribute( | 674 browserAccessibility_->GetIntAttribute( |
| 675 ui::AX_ATTR_TABLE_CELL_ROW_INDEX, &row); | 675 ui::AX_ATTR_TABLE_CELL_ROW_INDEX, &row); |
| 676 browserAccessibility_->GetIntAttribute( | 676 browserAccessibility_->GetIntAttribute( |
| 677 ui::AX_ATTR_TABLE_CELL_ROW_SPAN, &rowspan); | 677 ui::AX_ATTR_TABLE_CELL_ROW_SPAN, &rowspan); |
| 678 if (row >= 0 && rowspan >= 1) | 678 if (row >= 0 && rowspan >= 1) |
| 679 return [NSValue valueWithRange:NSMakeRange(row, rowspan)]; | 679 return [NSValue valueWithRange:NSMakeRange(row, rowspan)]; |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 continue; | 1067 continue; |
| 1068 } | 1068 } |
| 1069 if (rowIndex < row) | 1069 if (rowIndex < row) |
| 1070 continue; | 1070 continue; |
| 1071 if (rowIndex > row) | 1071 if (rowIndex > row) |
| 1072 break; | 1072 break; |
| 1073 for (size_t j = 0; | 1073 for (size_t j = 0; |
| 1074 j < child->PlatformChildCount(); | 1074 j < child->PlatformChildCount(); |
| 1075 ++j) { | 1075 ++j) { |
| 1076 BrowserAccessibility* cell = child->PlatformGetChild(j); | 1076 BrowserAccessibility* cell = child->PlatformGetChild(j); |
| 1077 if (cell->GetRole() != ui::AX_ROLE_CELL) | 1077 if (!browserAccessibility_->IsCellOrTableHeaderRole()) |
| 1078 continue; | 1078 continue; |
| 1079 int colIndex; | 1079 int colIndex; |
| 1080 if (!cell->GetIntAttribute( | 1080 if (!cell->GetIntAttribute( |
| 1081 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, | 1081 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, |
| 1082 &colIndex)) { | 1082 &colIndex)) { |
| 1083 continue; | 1083 continue; |
| 1084 } | 1084 } |
| 1085 if (colIndex == column) | 1085 if (colIndex == column) |
| 1086 return cell->ToBrowserAccessibilityCocoa(); | 1086 return cell->ToBrowserAccessibilityCocoa(); |
| 1087 if (colIndex > column) | 1087 if (colIndex > column) |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 return [super hash]; | 1532 return [super hash]; |
| 1533 return browserAccessibility_->GetId(); | 1533 return browserAccessibility_->GetId(); |
| 1534 } | 1534 } |
| 1535 | 1535 |
| 1536 - (BOOL)accessibilityShouldUseUniqueId { | 1536 - (BOOL)accessibilityShouldUseUniqueId { |
| 1537 return YES; | 1537 return YES; |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 @end | 1540 @end |
| 1541 | 1541 |
| OLD | NEW |