|Summary:||REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity|
|Product:||WebKit||Reporter:||David Kilzer (:ddkilzer) <ddkilzer>|
|Severity:||Normal||CC:||dbates, esprehn+autocc, ews-watchlist, glenn, jonlee, koivisto, kondapallykalyan, mmaxfield, pdr, webkit-bug-importer, wenson_hsieh, zalan|
|Version:||WebKit Nightly Build|
|Bug Depends on:||201181|
Description David Kilzer (:ddkilzer) 2020-04-17 15:55:02 PDT
Summary: Pasting text that ends with a newline, then immediately deleting that newline, results in a discontinuity in a <textarea> element. Steps to Reproduce 1. Load URL: <data:text/html,%3ctextarea%3e%3c/textarea%3e> 2. Resize. 3. Type in "lorem\n\n\n\nipsum\n" (hit the Enter key for each newline). 4. Select "lorem" plus its ending newline and copy to pasteboard. 5. Position insertion bar on line 3 (blank line between "lorem and ipsum"). 6. Paste text. 7. Immediately hit Delete key. Expected Results: Blank line should be deleted after pasting "lorem\n". Actual Results: Blank is deleted, but the text is not redrawn with the line removed. Moving the insertion bar with left/right arrow keys will show it jump over the deleted newline. (Using up/down arrow keys will actually not move the insertion bar past the deleted newline.) Regression: Via bisection, this regressed in r249160 which was the fix for Bug 201181: Bug 201181: InlineTextBox::end() should return first-past-end offset <https://bugs.webkit.org/show_bug.cgi?id=201181> <rdar://problem/54758922> <https://trac.webkit.org/changeset/249160/webkit>
Comment 2 David Kilzer (:ddkilzer) 2020-04-17 16:06:31 PDT
Forcing a repaint in Safari does not “fix” the discontinuity. You can fix it by deleting the next blank line after the discontinuity (which makes the deletion jump up two lines), then hit Enter again to make it appear the way it should have originally.
Comment 3 Jon Lee 2020-04-17 16:50:05 PDT
At the end of the second "lorem" line, I can't press the down key to go to the next line.
Comment 4 David Kilzer (:ddkilzer) 2020-04-18 13:35:11 PDT
(In reply to Jon Lee from comment #3) > At the end of the second "lorem" line, I can't press the down key to go to > the next line. As noted in Comment #0: > (Using up/down arrow keys will actually not move the insertion bar past the deleted newline.) Part of the behavior of this bug.