| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 AXObject* AXTableCell::titleUIElement() const | 188 AXObject* AXTableCell::titleUIElement() const |
| 189 { | 189 { |
| 190 // Try to find if the first cell in this row is a <th>. If it is, | 190 // Try to find if the first cell in this row is a <th>. If it is, |
| 191 // then it can act as the title ui element. (This is only in the | 191 // then it can act as the title ui element. (This is only in the |
| 192 // case when the table is not appearing as an AXTable.) | 192 // case when the table is not appearing as an AXTable.) |
| 193 if (isTableCell() || !m_renderer || !m_renderer->isTableCell()) | 193 if (isTableCell() || !m_renderer || !m_renderer->isTableCell()) |
| 194 return 0; | 194 return 0; |
| 195 | 195 |
| 196 // Table cells that are th cannot have title ui elements, since by definitio
n | 196 // Table cells that are th cannot have title ui elements, since by definitio
n |
| 197 // they are title ui elements | 197 // they are title ui elements |
| 198 Node* node = m_renderer->node(); | 198 if (isTableHeaderCell()) |
| 199 if (node && node->hasTagName(thTag)) | |
| 200 return 0; | 199 return 0; |
| 201 | 200 |
| 202 RenderTableCell* renderCell = toRenderTableCell(m_renderer); | 201 RenderTableCell* renderCell = toRenderTableCell(m_renderer); |
| 203 | 202 |
| 204 // If this cell is in the first column, there is no need to continue. | 203 // If this cell is in the first column, there is no need to continue. |
| 205 int col = renderCell->col(); | 204 int col = renderCell->col(); |
| 206 if (!col) | 205 if (!col) |
| 207 return 0; | 206 return 0; |
| 208 | 207 |
| 209 int row = renderCell->rowIndex(); | 208 int row = renderCell->rowIndex(); |
| 210 | 209 |
| 211 RenderTableSection* section = renderCell->section(); | 210 RenderTableSection* section = renderCell->section(); |
| 212 if (!section) | 211 if (!section) |
| 213 return 0; | 212 return 0; |
| 214 | 213 |
| 215 RenderTableCell* headerCell = section->primaryCellAt(row, 0); | 214 RenderTableCell* headerCell = section->primaryCellAt(row, 0); |
| 216 if (!headerCell || headerCell == renderCell) | 215 if (!headerCell || headerCell == renderCell) |
| 217 return 0; | 216 return 0; |
| 218 | 217 |
| 219 Node* cellElement = headerCell->node(); | 218 Node* cellElement = headerCell->node(); |
| 220 if (!cellElement || !cellElement->hasTagName(thTag)) | 219 if (!cellElement || !cellElement->hasTagName(thTag)) |
| 221 return 0; | 220 return 0; |
| 222 | 221 |
| 223 return axObjectCache()->getOrCreate(headerCell); | 222 return axObjectCache()->getOrCreate(headerCell); |
| 224 } | 223 } |
| 225 | 224 |
| 226 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |