Chromium Code Reviews| Index: Source/modules/accessibility/AXTableCell.cpp |
| diff --git a/Source/modules/accessibility/AXTableCell.cpp b/Source/modules/accessibility/AXTableCell.cpp |
| index 5ac20bceac67f4bece673306b794cc5799606b1b..a8064c6843ea1ae11816dd6a7119d3aa64de8274 100644 |
| --- a/Source/modules/accessibility/AXTableCell.cpp |
| +++ b/Source/modules/accessibility/AXTableCell.cpp |
| @@ -108,14 +108,18 @@ bool AXTableCell::isTableCell() const |
| return true; |
| } |
| -static AccessibilityRole decideRoleFromSibling(Node* siblingNode) |
| +static AccessibilityRole decideRoleFromSibling(LayoutTableCell* cell) |
|
dmazzoni
2015/03/16 15:12:16
I like naming the argument "sibling", so maybe sib
|
| { |
| - if (!siblingNode) |
| + if (!cell) |
| return CellRole; |
| - if (siblingNode->hasTagName(thTag)) |
| - return ColumnHeaderRole; |
| - if (siblingNode->hasTagName(tdTag)) |
| - return RowHeaderRole; |
| + |
| + if (Node* siblingNode = cell->node()) { |
|
dmazzoni
2015/03/16 15:12:16
I think you need extra parentheses otherwise some
|
| + if (siblingNode->hasTagName(thTag)) |
| + return ColumnHeaderRole; |
| + if (siblingNode->hasTagName(tdTag)) |
| + return RowHeaderRole; |
| + } |
| + |
| return CellRole; |
| } |
| @@ -137,20 +141,14 @@ AccessibilityRole AXTableCell::scanToDecideHeaderRole() |
| // if header is preceded by header cells on the same row, then it is a |
| // column header. If it is preceded by other cells then it's a row header. |
| - if (LayoutTableCell* cell = layoutCell->previousCell()) { |
| - Node* siblingNode = cell->node(); |
| - headerRole = decideRoleFromSibling(siblingNode); |
| - if (headerRole != CellRole) |
| - return headerRole; |
| - } |
| + if ((headerRole = decideRoleFromSibling(layoutCell->previousCell())) != CellRole) |
| + return headerRole; |
| + |
| // if header is followed by header cells on the same row, then it is a |
| // column header. If it is followed by other cells then it's a row header. |
| - if (LayoutTableCell* cell = layoutCell->nextCell()) { |
| - Node* siblingNode = cell->node(); |
| - headerRole = decideRoleFromSibling(siblingNode); |
| - if (headerRole != CellRole) |
| - return headerRole; |
| - } |
| + if ((headerRole = decideRoleFromSibling(layoutCell->nextCell())) != CellRole) |
| + return headerRole; |
| + |
| // If there are no other cells on that row, then it is a column header. |
| return ColumnHeaderRole; |
| } |