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

Unified Diff: Source/core/editing/htmlediting.cpp

Issue 171953002: Get rid of inefficient uses of childNodeCount() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use lastChild() 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/editing/TextIterator.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 11295afa05ba1a8866a0b4a5b4893a28398fd901..501df6febcd320b6f8363059268641f98228ecdf 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -503,7 +503,7 @@ Node* isLastPositionBeforeTable(const VisiblePosition& visiblePosition)
VisiblePosition visiblePositionBeforeNode(Node* node)
{
ASSERT(node);
- if (node->childNodeCount())
+ if (node->hasChildNodes())
return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNSTREAM);
ASSERT(node->parentNode());
ASSERT(!node->parentNode()->isShadowRoot());
@@ -514,7 +514,7 @@ VisiblePosition visiblePositionBeforeNode(Node* node)
VisiblePosition visiblePositionAfterNode(Node* node)
{
ASSERT(node);
- if (node->childNodeCount())
+ if (node->hasChildNodes())
return VisiblePosition(lastPositionInOrAfterNode(node), DOWNSTREAM);
ASSERT(node->parentNode());
ASSERT(!node->parentNode()->isShadowRoot());
« no previous file with comments | « Source/core/editing/TextIterator.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698