Chromium Code Reviews
DescriptionTEXTAREA: Cutting last line without EOL should not remove the remaining EOL in the previous line.
Our TEXTAREA element assumes there is an extra trailing <BR> or \n if the last
character of the value is \n. So we remove the last \n when we generate value
from innerEditor content.
However, the assumption was broken if we cut the last line content without EOL.
Editing code doesn't add an extra <BR> in such case. We removed the last \n in
the value mistakenly.
Solution:
We should make sure there no <BR> elements in innerEditor except the extra trailing
one so that we can ignore it safely on generating TEXTAREA value.
Also, we should make sure editing code doesn't add \n for placeholder newline.
- HTMLTextAreaElement simply ignore the last <BR> on generating value.
- HTMLTextAreaElement makes sure that innerEditor has the last <BR> after
every editing operations.
- InsertLineBreakCommand always inserts \n for plain text editing field, however
it produces <BR> as an extra line break for TEXTAREA.
- ReplaceSelectionCommand appends a <BR> for an InterchangeNewline at the end.
- InsertTextCommand should not produce TabSpans for plain text editing.
BUG=522144, 593184
Committed: https://crrev.com/37f57d892222dc0ed816ae004074d7c80600ad46
Cr-Commit-Position: refs/heads/master@{#380385}
Patch Set 1 : #
Total comments: 4
Patch Set 2 : remove an ASSERT, update a comment #Depends on Patchset: Messages
Total messages: 13 (7 generated)
|