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

Unified Diff: Source/core/dom/Node.cpp

Issue 171663005: Consistently use ElementTraversal API when looking for an Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/HTMLAppletElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 1671ca9b37c28770438f50fe740663bdc7048343..0623975c6ac9cafdefc013ea77129692341cf520 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -2471,9 +2471,9 @@ void Node::unregisterScopedHTMLStyleChild()
size_t Node::numberOfScopedHTMLStyleChildren() const
{
size_t count = 0;
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
+ for (Element* child = ElementTraversal::firstWithin(*this); child; child = ElementTraversal::nextSibling(*child)) {
if (child->hasTagName(HTMLNames::styleTag) && toHTMLStyleElement(child)->isRegisteredAsScoped())
- count++;
+ ++count;
}
return count;
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/HTMLAppletElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698