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

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

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLTablePartElement.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 8d37d0eb0cc43ddf796049e7ead1b6257de12e3c..79882ae1ce9f78185857686d30cc423344e1debf 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -59,7 +59,7 @@ int HTMLTableRowElement::rowIndex() const
if (!table)
return -1;
table = table->parentNode();
- if (!table || !table->hasTagName(tableTag))
+ if (!table || !isHTMLTableElement(table))
return -1;
// To match Firefox, the row indices work like this:
@@ -69,7 +69,7 @@ int HTMLTableRowElement::rowIndex() const
int rIndex = 0;
- if (HTMLTableSectionElement* head = static_cast<HTMLTableElement*>(table)->tHead()) {
+ if (HTMLTableSectionElement* head = toHTMLTableElement(table)->tHead()) {
for (Node *row = head->firstChild(); row; row = row->nextSibling()) {
if (row == this)
return rIndex;
@@ -77,7 +77,7 @@ int HTMLTableRowElement::rowIndex() const
++rIndex;
}
}
-
+
for (Node *node = table->firstChild(); node; node = node->nextSibling()) {
if (node->hasTagName(tbodyTag)) {
HTMLTableSectionElement* section = static_cast<HTMLTableSectionElement*>(node);
@@ -90,7 +90,7 @@ int HTMLTableRowElement::rowIndex() const
}
}
- if (HTMLTableSectionElement* foot = static_cast<HTMLTableElement*>(table)->tFoot()) {
+ if (HTMLTableSectionElement* foot = toHTMLTableElement(table)->tFoot()) {
for (Node *row = foot->firstChild(); row; row = row->nextSibling()) {
if (row == this)
return rIndex;
« no previous file with comments | « Source/core/html/HTMLTablePartElement.cpp ('k') | Source/core/html/HTMLTableRowsCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698