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

Unified Diff: Source/core/html/HTMLTableRowsCollection.cpp

Issue 182583002: Revert of Add template parameter to ElementTraversal to iterate over Elements of a specific type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/core/dom/TreeWalker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTableRowsCollection.cpp
diff --git a/Source/core/html/HTMLTableRowsCollection.cpp b/Source/core/html/HTMLTableRowsCollection.cpp
index 18bacf530e8f0655b6749b1417bcf3b14d837a6a..21efc2cb3945bcc7c270e51f37c3832656d863f8 100644
--- a/Source/core/html/HTMLTableRowsCollection.cpp
+++ b/Source/core/html/HTMLTableRowsCollection.cpp
@@ -55,7 +55,11 @@
static inline HTMLTableRowElement* findTableRowElementInChildren(Element& current)
{
- return Traversal<HTMLTableRowElement>::firstWithin(current);
+ for (Element* child = ElementTraversal::firstWithin(current); child; child = ElementTraversal::nextSibling(*child)) {
+ if (isHTMLTableRowElement(child))
+ return toHTMLTableRowElement(child);
+ }
+ return 0;
}
HTMLTableRowElement* HTMLTableRowsCollection::rowAfter(HTMLTableElement& table, HTMLTableRowElement* previous)
@@ -65,8 +69,10 @@
// Start by looking for the next row in this section.
// Continue only if there is none.
if (previous && previous->parentNode() != table) {
- if (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::nextSibling(*previous))
- return row;
+ for (child = ElementTraversal::nextSibling(*previous); child; child = ElementTraversal::nextSibling(*child)) {
+ if (isHTMLTableRowElement(child))
+ return toHTMLTableRowElement(child);
+ }
}
// If still looking at head sections, find the first row in the next head section.
« no previous file with comments | « Source/core/dom/TreeWalker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698