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

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

Issue 471173003: Introduce HasHTMLTagName functor and use it with ElementTraversal (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment Created 6 years, 4 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/html/HTMLTableElement.cpp ('k') | Source/core/html/HTMLTableRowsCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTableRowElement.cpp
diff --git a/Source/core/html/HTMLTableRowElement.cpp b/Source/core/html/HTMLTableRowElement.cpp
index 8de109ad9a7b4170c30ae73083e38fdb32cfb759..de776cc3a42f27a26382a2b33f9379a75bc9f2e7 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -81,14 +81,11 @@ int HTMLTableRowElement::rowIndex() const
}
}
- for (HTMLElement* child = Traversal<HTMLElement>::firstChild(*table); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
- if (child->hasTagName(tbodyTag)) {
- HTMLTableSectionElement* section = toHTMLTableSectionElement(child);
- for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstChild(*section); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) {
- if (row == this)
- return rIndex;
- ++rIndex;
- }
+ for (HTMLElement* tbody = Traversal<HTMLElement>::firstChild(*table, HasHTMLTagName(tbodyTag)); tbody; tbody = Traversal<HTMLElement>::nextSibling(*tbody, HasHTMLTagName(tbodyTag))) {
+ for (HTMLTableRowElement* row = Traversal<HTMLTableRowElement>::firstChild(*tbody); row; row = Traversal<HTMLTableRowElement>::nextSibling(*row)) {
+ if (row == this)
+ return rIndex;
+ ++rIndex;
}
}
« no previous file with comments | « Source/core/html/HTMLTableElement.cpp ('k') | Source/core/html/HTMLTableRowsCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698