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

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

Issue 1119663002: Making Unicode character names consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code changes to correct Test Expectation Created 5 years, 7 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 97396f7fe46049e5e9536dbaf9ef5a918743eed5..3d3e32c7e76682949523ea172400e9cc8683da9b 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -119,7 +119,7 @@ String HTMLTextFormControlElement::strippedPlaceholder() const
// According to the HTML5 specification, we need to remove CR and LF from
// the attribute value.
const AtomicString& attributeValue = fastGetAttribute(placeholderAttr);
- if (!attributeValue.contains(newlineCharacter) && !attributeValue.contains(carriageReturn))
+ if (!attributeValue.contains(characterNewline) && !attributeValue.contains(characterCarriageReturn))
return attributeValue;
StringBuilder stripped;
@@ -127,14 +127,14 @@ String HTMLTextFormControlElement::strippedPlaceholder() const
stripped.reserveCapacity(length);
for (unsigned i = 0; i < length; ++i) {
UChar character = attributeValue[i];
- if (character == newlineCharacter || character == carriageReturn)
+ if (character == characterNewline || character == characterCarriageReturn)
continue;
stripped.append(character);
}
return stripped.toString();
}
-static bool isNotLineBreak(UChar ch) { return ch != newlineCharacter && ch != carriageReturn; }
+static bool isNotLineBreak(UChar ch) { return ch != characterNewline && ch != characterCarriageReturn; }
bool HTMLTextFormControlElement::isPlaceholderEmpty() const
{
@@ -658,7 +658,7 @@ String HTMLTextFormControlElement::innerEditorValue() const
StringBuilder result;
for (Node& node : NodeTraversal::inclusiveDescendantsOf(*innerEditor)) {
if (isHTMLBRElement(node))
- result.append(newlineCharacter);
+ result.append(characterNewline);
else if (node.isTextNode())
result.append(toText(node).data());
}
@@ -705,7 +705,7 @@ String HTMLTextFormControlElement::valueWithHardLineBreaks() const
StringBuilder result;
for (Node& node : NodeTraversal::descendantsOf(*innerText)) {
if (isHTMLBRElement(node)) {
- result.append(newlineCharacter);
+ result.append(characterNewline);
} else if (node.isTextNode()) {
String data = toText(node).data();
unsigned length = data.length();
@@ -714,7 +714,7 @@ String HTMLTextFormControlElement::valueWithHardLineBreaks() const
if (breakOffset > position) {
result.append(data, position, breakOffset - position);
position = breakOffset;
- result.append(newlineCharacter);
+ result.append(characterNewline);
}
getNextSoftBreak(line, breakNode, breakOffset);
}

Powered by Google App Engine
This is Rietveld 408576698