LayoutTests:
Reviewed by darin
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8624>
Placeholders aren't always removed during paste
<rdar://problem/
4059807>
Seed: Mail: pasting quoted content sometimes adds a phantom newline
If a webkit-block-placeholder has been introduced by a bug in deletion,
we shouldn't remove it during paste if it is now acting as a linebreak.
* editing/pasteboard/bad-placeholder-expected.checksum: Added.
* editing/pasteboard/bad-placeholder-expected.png: Added.
* editing/pasteboard/bad-placeholder-expected.txt: Added.
* editing/pasteboard/bad-placeholder.html: Added.
Generic placeholder brs should be removed if they are displaced by pasted content.
* editing/pasteboard/displaced-generic-placeholder-expected.checksum: Added.
* editing/pasteboard/displaced-generic-placeholder-expected.png: Added.
* editing/pasteboard/displaced-generic-placeholder-expected.txt: Added.
* editing/pasteboard/displaced-generic-placeholder.html: Added.
So should placeholder brs with our special class on them.
* editing/pasteboard/displaced-placeholder-expected.checksum: Added.
* editing/pasteboard/displaced-placeholder-expected.png: Added.
* editing/pasteboard/displaced-placeholder-expected.txt: Added.
* editing/pasteboard/displaced-placeholder.html: Added.
Removed an unnecessary collapsed br.
* editing/pasteboard/paste-text-010-expected.txt:
Two fixes, an extra line was present after pasting with an interchange newline.
* editing/pasteboard/paste-text-016-expected.checksum: Added.
* editing/pasteboard/paste-text-016-expected.png: Added.
* editing/pasteboard/paste-text-016-expected.txt: Added.
* editing/pasteboard/paste-text-017-expected.checksum: Added.
* editing/pasteboard/paste-text-017-expected.png: Added.
* editing/pasteboard/paste-text-017-expected.txt: Added.
The code that interprets the incoming br as a br in strict mode had a bug.
* editing/pasteboard/quirks-mode-br-1-expected.checksum: Added.
* editing/pasteboard/quirks-mode-br-1-expected.png: Added.
* editing/pasteboard/quirks-mode-br-1-expected.txt: Added.
* editing/pasteboard/quirks-mode-br-1.html: Added.
The linePlaceholder removal was negating the work to interpret the last
incoming br as a br in strict mode.
* editing/pasteboard/quirks-mode-br-2-expected.checksum: Added.
* editing/pasteboard/quirks-mode-br-2-expected.png: Added.
* editing/pasteboard/quirks-mode-br-2-expected.txt: Added.
* editing/pasteboard/quirks-mode-br-2.html: Added.
Don't let collapsed brs become rendered as a result of the paste operation.
* editing/pasteboard/unrendered-br-expected.checksum: Added.
* editing/pasteboard/unrendered-br-expected.png: Added.
* editing/pasteboard/unrendered-br-expected.txt: Added.
* editing/pasteboard/unrendered-br.html: Added.
WebCore:
Reviewed by darin
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8624>
Placeholders aren't always removed during paste
<rdar://problem/
4059807>
Seed: Mail: pasting quoted content sometimes adds a phantom newline
* editing/CompositeEditCommand.cpp: Added a FIXME.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Removed two no-op setEndingSelection calls.
Store away a br at the position where we'll start inserting content in case the
br a) is made unnecessary by the insertion (it's collapsed away) b) was acting
as a placeholder and should therefore be displaced by inserted content or c) was
acting as a line break and, as a result of the insertion, is now acting as a
placeholder.
Don't only store away brs that have the webkit-block-placeholder class on them.
Any br that does any of the three things just mentioned should be removed.
The linePlaceholder removal was run after the code that makes sure to interpret
incoming brs strictly, and was negating that work in certain cases.
(WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
* editing/ReplaceSelectionCommand.h:
* editing/VisiblePosition.cpp:
(WebCore::isEqualIgnoringAffinity):
Added a workaround for 8622. We want this function to return true even if one of
the two visible positions has been incorrectly canonicalized.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14086
268f45cc-cd09-0410-ab3c-
d52691b4dbfc