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

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

Issue 175693007: Generate isHTML*Element() / toHTML*Element() helper functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make toHTMLObjectElement() work for FormAssociatedElement input 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
Index: Source/core/html/HTMLTableRowsCollection.cpp
diff --git a/Source/core/html/HTMLTableRowsCollection.cpp b/Source/core/html/HTMLTableRowsCollection.cpp
index ae67c03a695ed3db9812a0909f173683f5b37772..5dbaeddc23f71d10e9e074579bfdadc11a3eb904 100644
--- a/Source/core/html/HTMLTableRowsCollection.cpp
+++ b/Source/core/html/HTMLTableRowsCollection.cpp
@@ -56,7 +56,7 @@ static bool isInFoot(Element* row)
static inline HTMLTableRowElement* findTableRowElementInChildren(Element& current)
{
for (Element* child = ElementTraversal::firstWithin(current); child; child = ElementTraversal::nextSibling(*child)) {
- if (child->hasTagName(trTag))
+ if (isHTMLTableRowElement(child))
return toHTMLTableRowElement(child);
}
return 0;
@@ -70,7 +70,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::rowAfter(HTMLTableElement* table,
// Continue only if there is none.
if (previous && previous->parentNode() != table) {
for (child = ElementTraversal::nextSibling(*previous); child; child = ElementTraversal::nextSibling(*child)) {
- if (child->hasTagName(trTag))
+ if (isHTMLTableRowElement(child))
return toHTMLTableRowElement(child);
}
}
@@ -95,7 +95,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::rowAfter(HTMLTableElement* table,
else if (isInBody(previous))
child = ElementTraversal::nextSibling(*previous->parentNode());
for (; child; child = ElementTraversal::nextSibling(*child)) {
- if (child->hasTagName(trTag))
+ if (isHTMLTableRowElement(child))
return toHTMLTableRowElement(child);
if (child->hasTagName(tbodyTag)) {
if (HTMLTableRowElement* row = findTableRowElementInChildren(*child))
@@ -123,18 +123,18 @@ HTMLTableRowElement* HTMLTableRowsCollection::lastRow(HTMLTableElement* table)
for (Node* child = table->lastChild(); child; child = child->previousSibling()) {
if (child->hasTagName(tfootTag)) {
for (Node* grandchild = child->lastChild(); grandchild; grandchild = grandchild->previousSibling()) {
- if (grandchild->hasTagName(trTag))
+ if (isHTMLTableRowElement(grandchild))
return toHTMLTableRowElement(grandchild);
}
}
}
for (Node* child = table->lastChild(); child; child = child->previousSibling()) {
- if (child->hasTagName(trTag))
+ if (isHTMLTableRowElement(child))
return toHTMLTableRowElement(child);
if (child->hasTagName(tbodyTag)) {
for (Node* grandchild = child->lastChild(); grandchild; grandchild = grandchild->previousSibling()) {
- if (grandchild->hasTagName(trTag))
+ if (isHTMLTableRowElement(grandchild))
return toHTMLTableRowElement(grandchild);
}
}
@@ -143,7 +143,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::lastRow(HTMLTableElement* table)
for (Node* child = table->lastChild(); child; child = child->previousSibling()) {
if (child->hasTagName(theadTag)) {
for (Node* grandchild = child->lastChild(); grandchild; grandchild = grandchild->previousSibling()) {
- if (grandchild->hasTagName(trTag))
+ if (isHTMLTableRowElement(grandchild))
return toHTMLTableRowElement(grandchild);
}
}
@@ -158,7 +158,7 @@ HTMLTableRowElement* HTMLTableRowsCollection::lastRow(HTMLTableElement* table)
HTMLTableRowsCollection::HTMLTableRowsCollection(ContainerNode* table)
: HTMLCollection(table, TableRows, OverridesItemAfter)
{
- ASSERT(table->hasTagName(tableTag));
+ ASSERT(isHTMLTableElement(table));
}
PassRefPtr<HTMLTableRowsCollection> HTMLTableRowsCollection::create(ContainerNode* table, CollectionType)

Powered by Google App Engine
This is Rietveld 408576698