Commit 934fc8c7 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Textarea: Remove unnecessary code for non-last BRs

ValueWithHardLineBreaks() assumes InnerEditor elements don't contain
<br>s other than the last child. DCHECK()s check the assumption, and
don't need to emit LFs for non-last <br>s.

This CL should not change any behavior.

Change-Id: Ifed37f35e01fb34c95c31d966066c25a86cdce81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462742
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815481}
parent 55c47560
......@@ -952,8 +952,6 @@ String TextControlElement::ValueWithHardLineBreaks() const {
for (Node& node : NodeTraversal::DescendantsOf(*inner_text)) {
if (IsA<HTMLBRElement>(node)) {
DCHECK_EQ(&node, inner_text->lastChild());
if (&node != inner_text->lastChild())
result.Append(kNewlineCharacter);
} else if (auto* text_node = DynamicTo<Text>(node)) {
String data = text_node->data();
unsigned length = data.length();
......@@ -989,8 +987,6 @@ String TextControlElement::ValueWithHardLineBreaks() const {
for (Node& node : NodeTraversal::DescendantsOf(*inner_text)) {
if (IsA<HTMLBRElement>(node)) {
DCHECK_EQ(&node, inner_text->lastChild());
if (&node != inner_text->lastChild())
result.Append(kNewlineCharacter);
} else if (auto* text_node = DynamicTo<Text>(node)) {
String data = text_node->data();
unsigned length = data.length();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment