[webkit-changes] [WebKit/WebKit] a4612d: Keep `br` while replacing plain texts with content...

Ahmad Saleem noreply at github.com
Wed Nov 30 16:45:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a4612d781cd3a4631a4e3d9875175f03adda2c2c
      https://github.com/WebKit/WebKit/commit/a4612d781cd3a4631a4e3d9875175f03adda2c2c
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2022-11-30 (Wed, 30 Nov 2022)

  Changed paths:
    A LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea-expected.txt
    A LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html
    M Source/WebCore/editing/ReplaceSelectionCommand.cpp

  Log Message:
  -----------
  Keep `br` while replacing plain texts with content ending with newline

Keep `br` while replacing plain texts with content ending with newline
https://bugs.webkit.org/show_bug.cgi?id=90206

Reviewed by Ryosuke Niwa.

Merge - https://src.chromium.org/viewvc/blink?view=revision&revision=165565

The <br> after the insert position was removed while inserting a text
ending with a newline. This caused the loss of the newline at the end
of the inserted text. This fix adds extra condition checking for this
scenario and keeps the <br> while replacing plain texts with content
ending with newline.

* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(ReplaceSelectionCommand::doApply): Update logic to account for 'br' while inserting text with newline
* LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html: Add Test Case
* LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea-expected.txt: Add Test Case Expectation

Canonical link: https://commits.webkit.org/257205@main




More information about the webkit-changes mailing list