Index: Source/modules/accessibility/AXTableRow.cpp |
diff --git a/Source/modules/accessibility/AXTableRow.cpp b/Source/modules/accessibility/AXTableRow.cpp |
index 9fe4024a9e8af1830abf9e49511664e426e3d77b..046587a8b5070d0cbb3dd1bdc62206eb28d43464 100644 |
--- a/Source/modules/accessibility/AXTableRow.cpp |
+++ b/Source/modules/accessibility/AXTableRow.cpp |
@@ -103,27 +103,12 @@ AXObject* AXTableRow::parentTable() const |
AXObject* AXTableRow::headerObject() |
{ |
- if (!m_renderer || !m_renderer->isTableRow()) |
- return 0; |
- |
- AccessibilityChildrenVector rowChildren = children(); |
- if (!rowChildren.size()) |
- return 0; |
- |
- // check the first element in the row to see if it is a TH element |
- AXObject* cell = rowChildren[0].get(); |
- if (!cell->isTableCell()) |
- return 0; |
- |
- LayoutObject* cellRenderer = toAXTableCell(cell)->renderer(); |
- if (!cellRenderer) |
- return 0; |
- |
- Node* cellNode = cellRenderer->node(); |
- if (!cellNode || !cellNode->hasTagName(thTag)) |
+ AccessibilityChildrenVector headers; |
+ headerObjectsForRow(headers); |
+ if (!headers.size()) |
return 0; |
- return cell; |
+ return headers[0].get(); |
} |
void AXTableRow::headerObjectsForRow(AccessibilityChildrenVector& headers) |