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

Issue 1785603002: TEXTAREA: Cutting last line without EOL should not remove the remaining EOL in the previous line. (Closed)

Created:
4 years, 9 months ago by tkent
Modified:
4 years, 9 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TEXTAREA: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -36 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/editing/pasteboard/copy-image-with-alt-text-expected.txt View 1 2 chunks +4 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html View 1 chunk +19 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol-expected.txt View 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4960120-1-expected.txt View 1 chunk +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp View 3 chunks +10 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp View 1 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTextFormControlElement.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp View 1 6 chunks +31 lines, -17 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 13 (7 generated)
tkent
yosin@, would you review this please? This CL will be the last one for crbug.com/522144. ...
4 years, 9 months ago (2016-03-10 05:41:25 UTC) #4
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/1785603002/diff/20001/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp File third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp (right): https://codereview.chromium.org/1785603002/diff/20001/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp#newcode278 third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp:278: // element. If we see other ...
4 years, 9 months ago (2016-03-10 08:33:15 UTC) #6
tkent
https://codereview.chromium.org/1785603002/diff/20001/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp File third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp (right): https://codereview.chromium.org/1785603002/diff/20001/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp#newcode278 third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp:278: // element. If we see other nodes, we need ...
4 years, 9 months ago (2016-03-10 08:42:38 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1785603002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1785603002/40001
4 years, 9 months ago (2016-03-10 09:42:40 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 9 months ago (2016-03-10 10:53:10 UTC) #11
commit-bot: I haz the power
4 years, 9 months ago (2016-03-10 10:54:11 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/37f57d892222dc0ed816ae004074d7c80600ad46
Cr-Commit-Position: refs/heads/master@{#380385}

Powered by Google App Engine
This is Rietveld 408576698