Chromium Code Reviews| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 int id = uniqueCellIds[i]; | 230 int id = uniqueCellIds[i]; |
| 231 BrowserAccessibility* cell = | 231 BrowserAccessibility* cell = |
| 232 browserAccessibility_->manager()->GetFromID(id); | 232 browserAccessibility_->manager()->GetFromID(id); |
| 233 if (cell && cell->GetRole() == ui::AX_ROLE_COLUMN_HEADER) | 233 if (cell && cell->GetRole() == ui::AX_ROLE_COLUMN_HEADER) |
| 234 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; | 234 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; |
| 235 } | 235 } |
| 236 return ret; | 236 return ret; |
| 237 } | 237 } |
| 238 | 238 |
| 239 - (NSValue*)columnIndexRange { | 239 - (NSValue*)columnIndexRange { |
| 240 if (!browserAccessibility_->IsCellOrTableHeaderRole()) | 240 if (!browserAccessibility_->IsCellOrTableHeaderRole([self internalRole])) |
| 241 return nil; | 241 return nil; |
| 242 | 242 |
| 243 int column = -1; | 243 int column = -1; |
| 244 int colspan = -1; | 244 int colspan = -1; |
| 245 browserAccessibility_->GetIntAttribute( | 245 browserAccessibility_->GetIntAttribute( |
| 246 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, &column); | 246 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, &column); |
| 247 browserAccessibility_->GetIntAttribute( | 247 browserAccessibility_->GetIntAttribute( |
| 248 ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, &colspan); | 248 ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, &colspan); |
| 249 if (column >= 0 && colspan >= 1) | 249 if (column >= 0 && colspan >= 1) |
| 250 return [NSValue valueWithRange:NSMakeRange(column, colspan)]; | 250 return [NSValue valueWithRange:NSMakeRange(column, colspan)]; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 703 int id = uniqueCellIds[i]; | 703 int id = uniqueCellIds[i]; |
| 704 BrowserAccessibility* cell = | 704 BrowserAccessibility* cell = |
| 705 browserAccessibility_->manager()->GetFromID(id); | 705 browserAccessibility_->manager()->GetFromID(id); |
| 706 if (cell && cell->GetRole() == ui::AX_ROLE_ROW_HEADER) | 706 if (cell && cell->GetRole() == ui::AX_ROLE_ROW_HEADER) |
| 707 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; | 707 [ret addObject:cell->ToBrowserAccessibilityCocoa()]; |
| 708 } | 708 } |
| 709 return ret; | 709 return ret; |
| 710 } | 710 } |
| 711 | 711 |
| 712 - (NSValue*)rowIndexRange { | 712 - (NSValue*)rowIndexRange { |
| 713 if (!browserAccessibility_->IsCellOrTableHeaderRole()) | 713 if (!browserAccessibility_->IsCellOrTableHeaderRole([self internalRole])) |
| 714 return nil; | 714 return nil; |
| 715 | 715 |
| 716 int row = -1; | 716 int row = -1; |
| 717 int rowspan = -1; | 717 int rowspan = -1; |
| 718 browserAccessibility_->GetIntAttribute( | 718 browserAccessibility_->GetIntAttribute( |
| 719 ui::AX_ATTR_TABLE_CELL_ROW_INDEX, &row); | 719 ui::AX_ATTR_TABLE_CELL_ROW_INDEX, &row); |
| 720 browserAccessibility_->GetIntAttribute( | 720 browserAccessibility_->GetIntAttribute( |
| 721 ui::AX_ATTR_TABLE_CELL_ROW_SPAN, &rowspan); | 721 ui::AX_ATTR_TABLE_CELL_ROW_SPAN, &rowspan); |
| 722 if (row >= 0 && rowspan >= 1) | 722 if (row >= 0 && rowspan >= 1) |
| 723 return [NSValue valueWithRange:NSMakeRange(row, rowspan)]; | 723 return [NSValue valueWithRange:NSMakeRange(row, rowspan)]; |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1139 continue; | 1139 continue; |
| 1140 } | 1140 } |
| 1141 if (rowIndex < row) | 1141 if (rowIndex < row) |
| 1142 continue; | 1142 continue; |
| 1143 if (rowIndex > row) | 1143 if (rowIndex > row) |
| 1144 break; | 1144 break; |
| 1145 for (size_t j = 0; | 1145 for (size_t j = 0; |
| 1146 j < child->PlatformChildCount(); | 1146 j < child->PlatformChildCount(); |
| 1147 ++j) { | 1147 ++j) { |
| 1148 BrowserAccessibility* cell = child->PlatformGetChild(j); | 1148 BrowserAccessibility* cell = child->PlatformGetChild(j); |
| 1149 if (!browserAccessibility_->IsCellOrTableHeaderRole()) | 1149 if (!browserAccessibility_->IsCellOrTableHeaderRole(cell->GetRole())) |
|
dmazzoni
2015/03/11 16:31:41
I think this line was the one that had the bug, ri
je_julie(Not used)
2015/03/11 23:21:16
You're right. I didn't see it correctly.
On 2015/
| |
| 1150 continue; | 1150 continue; |
| 1151 int colIndex; | 1151 int colIndex; |
| 1152 if (!cell->GetIntAttribute( | 1152 if (!cell->GetIntAttribute( |
| 1153 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, | 1153 ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, |
| 1154 &colIndex)) { | 1154 &colIndex)) { |
| 1155 continue; | 1155 continue; |
| 1156 } | 1156 } |
| 1157 if (colIndex == column) | 1157 if (colIndex == column) |
| 1158 return cell->ToBrowserAccessibilityCocoa(); | 1158 return cell->ToBrowserAccessibilityCocoa(); |
| 1159 if (colIndex > column) | 1159 if (colIndex > column) |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1618 if (!browserAccessibility_) | 1618 if (!browserAccessibility_) |
| 1619 return [super hash]; | 1619 return [super hash]; |
| 1620 return browserAccessibility_->GetId(); | 1620 return browserAccessibility_->GetId(); |
| 1621 } | 1621 } |
| 1622 | 1622 |
| 1623 - (BOOL)accessibilityShouldUseUniqueId { | 1623 - (BOOL)accessibilityShouldUseUniqueId { |
| 1624 return YES; | 1624 return YES; |
| 1625 } | 1625 } |
| 1626 | 1626 |
| 1627 @end | 1627 @end |
| OLD | NEW |