Don't insert spaces at the beginning of a newline when using smart-copy-paste
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 00:38:55 +0000 (00:38 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 00:38:55 +0000 (00:38 +0000)
commitaea33406943924027a288961c8b2c1f246bc7018
treed7dee988d03a45da5f668821715d76bfa4f88028
parent123f6d25621b474e8a3f86f94d69fcf81614d21c
Don't insert spaces at the beginning of a newline when using smart-copy-paste
https://bugs.webkit.org/show_bug.cgi?id=194070

Source/WebCore:

Reviewed by Tim Horton.

If our inserted content end is at the beginning of a paragraph, do not insert a space.
Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.

Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):

LayoutTests:

Add test for smart copy paste around newlines.
Rebaseline a test that is dependant on a console log that changes lines.
Add additional helper functions to ui-helper.js.

Reviewed by Tim Horton.

* editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea-expected.txt: Added.
* editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html: Added.
* http/tests/security/anchor-download-block-crossorigin-expected.txt:
* platform/mac/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.doubleClickAt):
(window.UIHelper.doubleClickAtThenDragTo):
(window.UIHelper.async.selectWordByDoubleTapOrClick):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html [new file with mode: 0644]
LayoutTests/http/tests/security/anchor-download-block-crossorigin-expected.txt
LayoutTests/platform/mac/TestExpectations
LayoutTests/resources/ui-helper.js
Source/WebCore/ChangeLog
Source/WebCore/editing/ReplaceSelectionCommand.cpp