LayoutTests:
Reviewed by darin
Fixed a select-after-replacement problem:
* editing/pasteboard/drag-drop-modifies-page-expected.checksum:
* editing/pasteboard/drag-drop-modifies-page-expected.png:
* editing/pasteboard/drag-drop-modifies-page-expected.txt:
The trailing interchange newline used to be lost:
* editing/pasteboard/paste-text-012-expected.checksum:
* editing/pasteboard/paste-text-012-expected.png:
* editing/pasteboard/paste-text-012-expected.txt:
* editing/pasteboard/paste-text-012.html:
* editing/pasteboard/paste-text-016-expected.checksum:
* editing/pasteboard/paste-text-016-expected.png:
* editing/pasteboard/paste-text-016-expected.txt:
* editing/pasteboard/paste-text-017-expected.checksum:
* editing/pasteboard/paste-text-017-expected.png:
* editing/pasteboard/paste-text-017-expected.txt:
Illustrates the bug fixed in smart replace whitespace handling:
* editing/pasteboard/smart-paste-008.html
* editing/pasteboard/smart-paste-008-expected.txt
* editing/pasteboard/smart-paste-008-expected.png
* editing/pasteboard/smart-paste-008-expected.checksum
WebCore:
Reviewed by darin
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Removed the code to find out if we must later add smart replace whitespace. We can
wait until we've done the insertion to figure it out, and the position sampled (startPos)
to make the decision about trailing whitespace was wrong.
Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
whitespace (2 and 3 were reversed because the end merge must happen before we can know
whether or not we need to add a trailing space).
Don't do an end merge if the last node inserted was a br because the end merge will
clobber it.
(WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
brs that are at the end of a block and not at the start of a block are not the one brs
that are collapsed because of quirks mode.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14294
268f45cc-cd09-0410-ab3c-
d52691b4dbfc