| Index: Source/modules/accessibility/AXTableCell.cpp
|
| diff --git a/Source/modules/accessibility/AXTableCell.cpp b/Source/modules/accessibility/AXTableCell.cpp
|
| index e3f42df552b1ae166c10e2e7dd5952428fffa2b6..6c2cb62dcdd21e8b53adc75fe3a34b6b61887ee8 100644
|
| --- a/Source/modules/accessibility/AXTableCell.cpp
|
| +++ b/Source/modules/accessibility/AXTableCell.cpp
|
| @@ -31,7 +31,7 @@
|
|
|
| #include "core/layout/LayoutTableCell.h"
|
| #include "modules/accessibility/AXObjectCacheImpl.h"
|
| -
|
| +#include "modules/accessibility/AXTable.h"
|
|
|
| namespace blink {
|
|
|
| @@ -160,6 +160,52 @@ AccessibilityRole AXTableCell::determineAccessibilityRole()
|
| return scanToDecideHeaderRole();
|
| }
|
|
|
| +void AXTableCell::rowHeadersForCell(AccessibilityChildrenVector& headers)
|
| +{
|
| + AXObject* parent = parentTable();
|
| + if (!parent || !parent->isAXTable())
|
| + return;
|
| +
|
| + AXTable* parentTable = toAXTable(parent);
|
| +
|
| + pair<unsigned, unsigned> rowRange;
|
| + rowIndexRange(rowRange);
|
| +
|
| + pair<unsigned, unsigned> columnRange;
|
| + columnIndexRange(columnRange);
|
| +
|
| + for (unsigned i = 0; i < columnRange.first; i++) {
|
| + AXTableCell* cell = parentTable->cellForColumnAndRow(i, rowRange.first);
|
| + if (!cell || !cell->isTableCell() || cell == this)
|
| + continue;
|
| + if (cell->scanToDecideHeaderRole() == RowHeaderRole)
|
| + headers.append(cell);
|
| + }
|
| +}
|
| +
|
| +void AXTableCell::columnHeadersForCell(AccessibilityChildrenVector& headers)
|
| +{
|
| + AXObject* parent = parentTable();
|
| + if (!parent || !parent->isAXTable())
|
| + return;
|
| +
|
| + AXTable* parentTable = toAXTable(parent);
|
| +
|
| + pair<unsigned, unsigned> rowRange;
|
| + rowIndexRange(rowRange);
|
| +
|
| + pair<unsigned, unsigned> columnRange;
|
| + columnIndexRange(columnRange);
|
| +
|
| + for (unsigned i = 0; i < rowRange.first; i++) {
|
| + AXTableCell* cell = parentTable->cellForColumnAndRow(columnRange.first, i);
|
| + if (!cell || !cell->isTableCell() || headers.contains(cell) || cell == this)
|
| + continue;
|
| + if (cell->scanToDecideHeaderRole() == ColumnHeaderRole)
|
| + headers.append(cell);
|
| + }
|
| +}
|
| +
|
| void AXTableCell::rowIndexRange(pair<unsigned, unsigned>& rowRange)
|
| {
|
| if (!m_renderer || !m_renderer->isTableCell())
|
|
|