Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6394)

Unified Diff: Source/modules/accessibility/AXTableRow.cpp

Issue 942183003: Remove some redundant code from accessibility table headers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXTableColumn.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/modules/accessibility/AXTableColumn.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698