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

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

Issue 428533006: Use ContainerNode::hasChildren() instead of firstChild() in conditionals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fix 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/dom/ScriptLoader.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeWalker.cpp
diff --git a/Source/core/dom/TreeWalker.cpp b/Source/core/dom/TreeWalker.cpp
index 805e48d753657551140edb7f5a91f26d4f7e3cfc..e85017ab8950473e3d60bc3b4eedc48adabcfe41 100644
--- a/Source/core/dom/TreeWalker.cpp
+++ b/Source/core/dom/TreeWalker.cpp
@@ -82,7 +82,7 @@ Node* TreeWalker::firstChild(ExceptionState& exceptionState)
m_current = node.release();
return m_current.get();
case NodeFilter::FILTER_SKIP:
- if (node->firstChild()) {
+ if (node->hasChildren()) {
node = node->firstChild();
continue;
}
@@ -189,7 +189,7 @@ Node* TreeWalker::nextSibling(ExceptionState& exceptionState)
m_current = sibling.release();
return m_current.get();
case NodeFilter::FILTER_SKIP:
- if (sibling->firstChild()) {
+ if (sibling->hasChildren()) {
sibling = sibling->firstChild();
node = sibling;
continue;
« no previous file with comments | « Source/core/dom/ScriptLoader.cpp ('k') | Source/core/editing/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698