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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with ariaTextAlternative Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return SortDirectionNone; 211 return SortDirectionNone;
212 if (equalIgnoringCase(ariaSort, "ascending")) 212 if (equalIgnoringCase(ariaSort, "ascending"))
213 return SortDirectionAscending; 213 return SortDirectionAscending;
214 if (equalIgnoringCase(ariaSort, "descending")) 214 if (equalIgnoringCase(ariaSort, "descending"))
215 return SortDirectionDescending; 215 return SortDirectionDescending;
216 if (equalIgnoringCase(ariaSort, "other")) 216 if (equalIgnoringCase(ariaSort, "other"))
217 return SortDirectionOther; 217 return SortDirectionOther;
218 return SortDirectionUndefined; 218 return SortDirectionUndefined;
219 } 219 }
220 220
221 AXObject* AXTableCell::deprecatedTitleUIElement() const
222 {
223 // Try to find if the first cell in this row is a <th>. If it is,
224 // then it can act as the title ui element. (This is only in the
225 // case when the table is not appearing as an AXTable.)
226 if (isTableCell() || !m_layoutObject || !m_layoutObject->isTableCell())
227 return 0;
228
229 // Table cells that are th cannot have title ui elements, since by definitio n
230 // they are title ui elements
231 if (isTableHeaderCell())
232 return 0;
233
234 LayoutTableCell* layoutCell = toLayoutTableCell(m_layoutObject);
235
236 // If this cell is in the first column, there is no need to continue.
237 int col = layoutCell->col();
238 if (!col)
239 return 0;
240
241 int row = layoutCell->rowIndex();
242
243 LayoutTableSection* section = layoutCell->section();
244 if (!section)
245 return 0;
246
247 LayoutTableCell* headerCell = section->primaryCellAt(row, 0);
248 if (!headerCell || headerCell == layoutCell)
249 return 0;
250
251 Node* cellElement = headerCell->node();
252 if (!cellElement || !cellElement->hasTagName(thTag))
253 return 0;
254
255 return axObjectCache().getOrCreate(headerCell);
256 }
257
258 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698