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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 LayoutObject* layoutObject = m_parent->getLayoutObject(); | 58 LayoutObject* layoutObject = m_parent->getLayoutObject(); |
59 if (!layoutObject) | 59 if (!layoutObject) |
60 return; | 60 return; |
61 | 61 |
62 if (!m_parent->isAXTable()) | 62 if (!m_parent->isAXTable()) |
63 return; | 63 return; |
64 | 64 |
65 if (toAXTable(m_parent)->isAriaTable()) { | 65 if (toAXTable(m_parent)->isAriaTable()) { |
66 for (const auto& cell : children()) { | 66 for (const auto& cell : children()) { |
67 if (cell->roleValue() == ColumnHeaderRole) | 67 if (cell->roleValue() == ColumnHeaderRole) |
68 headers.append(cell); | 68 headers.push_back(cell); |
69 } | 69 } |
70 return; | 70 return; |
71 } | 71 } |
72 | 72 |
73 if (!layoutObject->isTable()) | 73 if (!layoutObject->isTable()) |
74 return; | 74 return; |
75 | 75 |
76 LayoutTable* table = toLayoutTable(layoutObject); | 76 LayoutTable* table = toLayoutTable(layoutObject); |
77 LayoutTableSection* tableSection = table->topSection(); | 77 LayoutTableSection* tableSection = table->topSection(); |
78 for (; tableSection; | 78 for (; tableSection; |
79 tableSection = table->sectionBelow(tableSection, SkipEmptySections)) { | 79 tableSection = table->sectionBelow(tableSection, SkipEmptySections)) { |
80 unsigned numCols = tableSection->numEffectiveColumns(); | 80 unsigned numCols = tableSection->numEffectiveColumns(); |
81 if (m_columnIndex >= numCols) | 81 if (m_columnIndex >= numCols) |
82 continue; | 82 continue; |
83 unsigned numRows = tableSection->numRows(); | 83 unsigned numRows = tableSection->numRows(); |
84 for (unsigned r = 0; r < numRows; r++) { | 84 for (unsigned r = 0; r < numRows; r++) { |
85 LayoutTableCell* layoutCell = | 85 LayoutTableCell* layoutCell = |
86 tableSection->primaryCellAt(r, m_columnIndex); | 86 tableSection->primaryCellAt(r, m_columnIndex); |
87 if (!layoutCell) | 87 if (!layoutCell) |
88 continue; | 88 continue; |
89 | 89 |
90 AXObject* cell = axObjectCache().getOrCreate(layoutCell->node()); | 90 AXObject* cell = axObjectCache().getOrCreate(layoutCell->node()); |
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() == ColumnHeaderRole) | 94 if (toAXTableCell(cell)->scanToDecideHeaderRole() == ColumnHeaderRole) |
95 headers.append(cell); | 95 headers.push_back(cell); |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 AXObject* AXTableColumn::headerObject() { | 100 AXObject* 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 |
(...skipping 27 matching lines...) Expand all Loading... |
133 | 133 |
134 for (int i = 0; i < numRows; i++) { | 134 for (int i = 0; i < numRows; i++) { |
135 AXTableCell* cell = parentTable->cellForColumnAndRow(m_columnIndex, i); | 135 AXTableCell* cell = parentTable->cellForColumnAndRow(m_columnIndex, i); |
136 if (!cell) | 136 if (!cell) |
137 continue; | 137 continue; |
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 (m_children.size() > 0 && m_children.back() == cell) | 140 if (m_children.size() > 0 && m_children.back() == cell) |
141 continue; | 141 continue; |
142 | 142 |
143 m_children.append(cell); | 143 m_children.push_back(cell); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |