LayoutTests:
Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8583>
Moving paste code around and some small fixes
Disabling until the bug it illustrates is fixed (8459):
* editing/deleting/merge-whitespace-pre.html: Removed.
* editing/deleting/merge-whitespace-pre.html-disabled: Added.
This illustrates the need to do mergeEnd in the opposite direction:
* editing/pasteboard/merge-end-borders-expected.checksum: Added.
* editing/pasteboard/merge-end-borders-expected.png: Added.
* editing/pasteboard/merge-end-borders-expected.txt: Added.
* editing/pasteboard/merge-end-borders.html: Added.
These illustrate the need to do the special case checks for list content and Mail
blockquote content at the top of shouldMergeStart:
* editing/pasteboard/merge-start-blockquote-expected.checksum: Added.
* editing/pasteboard/merge-start-blockquote-expected.png: Added.
* editing/pasteboard/merge-start-blockquote-expected.txt: Added.
* editing/pasteboard/merge-start-blockquote.html: Added.
* editing/pasteboard/merge-start-list-expected.checksum: Added.
* editing/pasteboard/merge-start-list-expected.png: Added.
* editing/pasteboard/merge-start-list-expected.txt: Added.
* editing/pasteboard/merge-start-list.html: Added.
In these tests, the caret was blown away because it was in content that
participated in the end merge. Now the end merge happens in the opposite
direction (incoming content is what is moved when merging paragraphs), so
the caret is no longer blown away:
* editing/pasteboard/paste-line-endings-007-expected.txt:
* editing/pasteboard/paste-line-endings-008-expected.txt:
* editing/pasteboard/paste-line-endings-009-expected.txt:
* editing/pasteboard/paste-text-002-expected.txt:
Acceptable change to a complicated paste-a-selection-over-itself:
* editing/pasteboard/paste-text-003-expected.checksum:
* editing/pasteboard/paste-text-003-expected.png:
* editing/pasteboard/paste-text-003-expected.txt:
WebCore:
Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8583>
Moving paste code around and some small fixes
Moved code to make it easier to do the start merge after the fact,
with moveParagraph, instead of in the middle of the paste operation.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraph):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
(WebCore::ReplaceSelectionCommand::shouldMergeStart):
Moved code to make this decision to its own function. Moved special case
checks to the top. Added m_forceMergeStart to override the special cases
because moveParagraph uses ReplaceSelectionCommand and expects a merge.
(WebCore::ReplaceSelectionCommand::shouldMergeEnd):
No functional changes, just moved code here.
(WebCore::ReplaceSelectionCommand::doApply):
Do the end merge in the opposite direction. Merging two paragraphs destroys
the moved one's block level styles, and we prefer to use the styles of the
one that was in the document, not the one that's being pasted.
* editing/ReplaceSelectionCommand.h:
* editing/Selection.h:
(WebCore::Selection::visibleStart): Added.
(WebCore::Selection::visibleEnd): Added.
* editing/htmlediting.cpp:
(WebCore::enclosingList): Added.
(WebCore::isMailBlockquote):
Don't require a renderer so that this can be used on nodes in fragments.
* editing/htmlediting.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14071
268f45cc-cd09-0410-ab3c-
d52691b4dbfc