| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 AXTableColumn::AXTableColumn(AXObjectCacheImpl& ax_object_cache) | 39 AXTableColumn::AXTableColumn(AXObjectCacheImpl& ax_object_cache) |
| 40 : AXMockObject(ax_object_cache) {} | 40 : AXMockObject(ax_object_cache) {} |
| 41 | 41 |
| 42 AXTableColumn::~AXTableColumn() {} | 42 AXTableColumn::~AXTableColumn() {} |
| 43 | 43 |
| 44 AXTableColumn* AXTableColumn::Create(AXObjectCacheImpl& ax_object_cache) { | 44 AXTableColumn* AXTableColumn::Create(AXObjectCacheImpl& ax_object_cache) { |
| 45 return new AXTableColumn(ax_object_cache); | 45 return new AXTableColumn(ax_object_cache); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void AXTableColumn::SetParent(AXObject* parent) { | 48 void AXTableColumn::SetParent(AXObjectImpl* parent) { |
| 49 AXMockObject::SetParent(parent); | 49 AXMockObject::SetParent(parent); |
| 50 | 50 |
| 51 ClearChildren(); | 51 ClearChildren(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void AXTableColumn::HeaderObjectsForColumn(AXObjectVector& headers) { | 54 void AXTableColumn::HeaderObjectsForColumn(AXObjectVector& headers) { |
| 55 if (!parent_) | 55 if (!parent_) |
| 56 return; | 56 return; |
| 57 | 57 |
| 58 LayoutObject* layout_object = parent_->GetLayoutObject(); | 58 LayoutObject* layout_object = parent_->GetLayoutObject(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 80 unsigned num_cols = table_section->NumEffectiveColumns(); | 80 unsigned num_cols = table_section->NumEffectiveColumns(); |
| 81 if (column_index_ >= num_cols) | 81 if (column_index_ >= num_cols) |
| 82 continue; | 82 continue; |
| 83 unsigned num_rows = table_section->NumRows(); | 83 unsigned num_rows = table_section->NumRows(); |
| 84 for (unsigned r = 0; r < num_rows; r++) { | 84 for (unsigned r = 0; r < num_rows; r++) { |
| 85 LayoutTableCell* layout_cell = | 85 LayoutTableCell* layout_cell = |
| 86 table_section->PrimaryCellAt(r, column_index_); | 86 table_section->PrimaryCellAt(r, column_index_); |
| 87 if (!layout_cell) | 87 if (!layout_cell) |
| 88 continue; | 88 continue; |
| 89 | 89 |
| 90 AXObject* cell = AxObjectCache().GetOrCreate(layout_cell->GetNode()); | 90 AXObjectImpl* cell = AxObjectCache().GetOrCreate(layout_cell->GetNode()); |
| 91 if (!cell || !cell->IsTableCell() || headers.Contains(cell)) | 91 if (!cell || !cell->IsTableCell() || headers.Contains(cell)) |
| 92 continue; | 92 continue; |
| 93 | 93 |
| 94 if (ToAXTableCell(cell)->ScanToDecideHeaderRole() == kColumnHeaderRole) | 94 if (ToAXTableCell(cell)->ScanToDecideHeaderRole() == kColumnHeaderRole) |
| 95 headers.push_back(cell); | 95 headers.push_back(cell); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 AXObject* AXTableColumn::HeaderObject() { | 100 AXObjectImpl* AXTableColumn::HeaderObject() { |
| 101 AXObjectVector headers; | 101 AXObjectVector headers; |
| 102 HeaderObjectsForColumn(headers); | 102 HeaderObjectsForColumn(headers); |
| 103 if (!headers.size()) | 103 if (!headers.size()) |
| 104 return 0; | 104 return 0; |
| 105 | 105 |
| 106 return headers[0].Get(); | 106 return headers[0].Get(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool AXTableColumn::ComputeAccessibilityIsIgnored( | 109 bool AXTableColumn::ComputeAccessibilityIsIgnored( |
| 110 IgnoredReasons* ignored_reasons) const { | 110 IgnoredReasons* ignored_reasons) const { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 138 | 138 |
| 139 // make sure the last one isn't the same as this one (rowspan cells) | 139 // make sure the last one isn't the same as this one (rowspan cells) |
| 140 if (children_.size() > 0 && children_.back() == cell) | 140 if (children_.size() > 0 && children_.back() == cell) |
| 141 continue; | 141 continue; |
| 142 | 142 |
| 143 children_.push_back(cell); | 143 children_.push_back(cell); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |