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

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

Issue 405973004: Optimize / clean up hasTagName() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/html/HTMLTableRowElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTableElement.cpp
diff --git a/Source/core/html/HTMLTableElement.cpp b/Source/core/html/HTMLTableElement.cpp
index b30585a8a6a60b9b6adf15a3dbc8beb2cade8508..95be5d366aa6919bd427f62b776c0234961dd5f6 100644
--- a/Source/core/html/HTMLTableElement.cpp
+++ b/Source/core/html/HTMLTableElement.cpp
@@ -77,7 +77,7 @@ void HTMLTableElement::setCaption(PassRefPtrWillBeRawPtr<HTMLTableCaptionElement
HTMLTableSectionElement* HTMLTableElement::tHead() const
{
- for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
+ for (HTMLElement* child = Traversal<HTMLElement>::firstWithin(*this); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
if (child->hasTagName(theadTag))
return toHTMLTableSectionElement(child);
}
@@ -88,8 +88,8 @@ void HTMLTableElement::setTHead(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>
{
deleteTHead();
- Element* child;
- for (child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
+ HTMLElement* child;
+ for (child = Traversal<HTMLElement>::firstWithin(*this); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag))
break;
}
@@ -99,7 +99,7 @@ void HTMLTableElement::setTHead(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>
HTMLTableSectionElement* HTMLTableElement::tFoot() const
{
- for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
+ for (HTMLElement* child = Traversal<HTMLElement>::firstWithin(*this); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
if (child->hasTagName(tfootTag))
return toHTMLTableSectionElement(child);
}
@@ -110,8 +110,8 @@ void HTMLTableElement::setTFoot(PassRefPtrWillBeRawPtr<HTMLTableSectionElement>
{
deleteTFoot();
- Element* child;
- for (child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
+ HTMLElement* child;
+ for (child = Traversal<HTMLElement>::firstWithin(*this); child; child = Traversal<HTMLElement>::nextSibling(*child)) {
if (!child->hasTagName(captionTag) && !child->hasTagName(colgroupTag) && !child->hasTagName(theadTag))
break;
}
@@ -172,7 +172,7 @@ void HTMLTableElement::deleteCaption()
HTMLTableSectionElement* HTMLTableElement::lastBody() const
{
- for (Node* child = lastChild(); child; child = child->previousSibling()) {
+ for (HTMLElement* child = Traversal<HTMLElement>::lastChild(*this); child; child = Traversal<HTMLElement>::previousSibling(*child)) {
if (child->hasTagName(tbodyTag))
return toHTMLTableSectionElement(child);
}
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/html/HTMLTableRowElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698