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

Unified Diff: Source/core/html/HTMLTextFormControlElement.cpp

Issue 195813003: Use new is*Element() helper functions further more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix bad assertion Created 6 years, 9 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
Index: Source/core/html/HTMLTextFormControlElement.cpp
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 916142fb8104317dde9c0ad81fbbf9b799dc550a..4bcbac9aceb65a7d53d7a5f68bddd48804bc52e6 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -442,7 +442,7 @@ PassRefPtr<Range> HTMLTextFormControlElement::selection() const
Node* endNode = 0;
for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(*node, innerText)) {
ASSERT(!node->firstChild());
- ASSERT(node->isTextNode() || node->hasTagName(brTag));
+ ASSERT(node->isTextNode() || isHTMLBRElement(*node));
int length = node->isTextNode() ? lastOffsetInNode(node) : 1;
if (offset <= start && start <= offset + length)
@@ -536,7 +536,7 @@ String HTMLTextFormControlElement::innerTextValue() const
StringBuilder result;
for (Node* node = innerText; node; node = NodeTraversal::next(*node, innerText)) {
- if (node->hasTagName(brTag))
+ if (isHTMLBRElement(*node))
result.append(newlineCharacter);
else if (node->isTextNode())
result.append(toText(node)->data());
@@ -583,7 +583,7 @@ String HTMLTextFormControlElement::valueWithHardLineBreaks() const
StringBuilder result;
for (Node* node = innerText->firstChild(); node; node = NodeTraversal::next(*node, innerText)) {
- if (node->hasTagName(brTag))
+ if (isHTMLBRElement(*node))
result.append(newlineCharacter);
else if (node->isTextNode()) {
String data = toText(node)->data();
« Source/core/html/HTMLMediaElement.cpp ('K') | « Source/core/html/HTMLTableRowElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698