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

Side by Side Diff: Source/core/accessibility/AXTable.cpp

Issue 405973004: Optimize / clean up hasTagName() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | Source/core/css/AffectedByFocusTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 if (elementHasAriaRole(bodyElement)) 137 if (elementHasAriaRole(bodyElement))
138 return false; 138 return false;
139 } 139 }
140 140
141 RefPtrWillBeRawPtr<HTMLTableRowsCollection> rows = tableElement->rows(); 141 RefPtrWillBeRawPtr<HTMLTableRowsCollection> rows = tableElement->rows();
142 unsigned rowCount = rows->length(); 142 unsigned rowCount = rows->length();
143 for (unsigned rowIndex = 0; rowIndex < rowCount; ++rowIndex) { 143 for (unsigned rowIndex = 0; rowIndex < rowCount; ++rowIndex) {
144 Element* rowElement = rows->item(rowIndex); 144 Element* rowElement = rows->item(rowIndex);
145 if (elementHasAriaRole(rowElement)) 145 if (elementHasAriaRole(rowElement))
146 return false; 146 return false;
147 if (rowElement->hasTagName(trTag)) { 147 if (isHTMLTableRowElement(*rowElement)) {
148 RefPtrWillBeRawPtr<HTMLCollection> cells = toHTMLTableRowElement(row Element)->cells(); 148 RefPtrWillBeRawPtr<HTMLCollection> cells = toHTMLTableRowElement(row Element)->cells();
149 for (unsigned cellIndex = 0; cellIndex < cells->length(); ++cellInde x) { 149 for (unsigned cellIndex = 0; cellIndex < cells->length(); ++cellInde x) {
150 if (elementHasAriaRole(cells->item(cellIndex))) 150 if (elementHasAriaRole(cells->item(cellIndex)))
151 return false; 151 return false;
152 } 152 }
153 } 153 }
154 } 154 }
155 155
156 // If there is a caption element, summary, THEAD, or TFOOT section, it's mos t certainly a data table 156 // If there is a caption element, summary, THEAD, or TFOOT section, it's mos t certainly a data table
157 if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElem ent->tFoot() || tableElement->caption()) 157 if (!tableElement->summary().isEmpty() || tableElement->tHead() || tableElem ent->tFoot() || tableElement->caption())
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 } 572 }
573 573
574 // try the standard 574 // try the standard
575 if (title.isEmpty()) 575 if (title.isEmpty())
576 title = AXRenderObject::title(); 576 title = AXRenderObject::title();
577 577
578 return title; 578 return title;
579 } 579 }
580 580
581 } // namespace blink 581 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXRenderObject.cpp ('k') | Source/core/css/AffectedByFocusTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698