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

Unified Diff: Source/core/editing/ReplaceSelectionCommand.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/ApplyStyleCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 984c9e076fe29414f4fb19e8cf5871a0575167d2..2e6bce9dd0bf875e3f6b2830e089b9bcd33d83aa 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -1417,7 +1417,7 @@ Node* ReplaceSelectionCommand::insertAsListItems(PassRefPtr<HTMLElement> prpList
{
RefPtr<HTMLElement> listElement = prpListElement;
- while (listElement->hasChildNodes() && isListElement(listElement->firstChild()) && listElement->childNodeCount() == 1)
+ while (listElement->hasChildNodes() && isListElement(listElement->firstChild()) && listElement->hasOneChild())
listElement = toHTMLElement(listElement->firstChild());
bool isStart = isStartOfParagraph(insertPos);
« no previous file with comments | « Source/core/editing/ApplyStyleCommand.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698