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

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

Issue 195813003: Use new is*Element() helper functions further more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bad assertion Created 6 years, 9 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
Index: Source/core/html/HTMLTableRowElement.cpp
diff --git a/Source/core/html/HTMLTableRowElement.cpp b/Source/core/html/HTMLTableRowElement.cpp
index 51f5245d039deefcbe772a8ea03acb8c4b9bb4da..2938abbc628716045e0528215fa67efd8e895919 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -55,7 +55,7 @@ int HTMLTableRowElement::rowIndex() const
if (!table)
return -1;
table = table->parentNode();
- if (!table || !table->hasTagName(tableTag))
+ if (!isHTMLTableElement(table))
return -1;
// To match Firefox, the row indices work like this:
@@ -99,13 +99,12 @@ int HTMLTableRowElement::rowIndex() const
int HTMLTableRowElement::sectionRowIndex() const
{
int rIndex = 0;
- const Node *n = this;
+ const Node* n = this;
do {
n = n->previousSibling();
- if (n && n->hasTagName(trTag))
- rIndex++;
- }
- while (n);
+ if (n && isHTMLTableRowElement(*n))
+ ++rIndex;
+ } while (n);
return rIndex;
}

Powered by Google App Engine
This is Rietveld 408576698