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

Unified Diff: Source/core/html/HTMLTextFormControlElement.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/editing/markup.cpp ('k') | Source/core/html/shadow/DateTimeEditElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index cae3020820f0623c0cdbb3749837c0d4ec571c34..6067d4792f8f78123e55300d0031c63204f73310 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -458,14 +458,14 @@ PassRefPtrWillBeRawPtr<Range> HTMLTextFormControlElement::selection() const
if (!innerText)
return nullptr;
- if (!innerText->firstChild())
+ if (!innerText->hasChildren())
return Range::create(document(), innerText, 0, innerText, 0);
int offset = 0;
Node* startNode = 0;
Node* endNode = 0;
for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(*node, innerText)) {
- ASSERT(!node->firstChild());
+ ASSERT(!node->hasChildren());
ASSERT(node->isTextNode() || isHTMLBRElement(*node));
int length = node->isTextNode() ? lastOffsetInNode(node) : 1;
« no previous file with comments | « Source/core/editing/markup.cpp ('k') | Source/core/html/shadow/DateTimeEditElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698