LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2006 04:33:43 +0000 (04:33 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2006 04:33:43 +0000 (04:33 +0000)
commitc01f673eb3a06aabe20cf470b822fc6a85286251
tree14691d748356051c94bf1bae76245c63640bf77f
parente1c3182b09ff15c92c8e7896717d729eea56f72a
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
28 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/merge-whitespace-pre.html-disabled [moved from LayoutTests/editing/deleting/merge-whitespace-pre.html with 100% similarity]
LayoutTests/editing/pasteboard/merge-end-borders-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-end-borders-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-end-borders-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-end-borders.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-blockquote-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-blockquote-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-blockquote-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-blockquote.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-list-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-list-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-list-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-start-list.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-line-endings-007-expected.txt
LayoutTests/editing/pasteboard/paste-line-endings-008-expected.txt
LayoutTests/editing/pasteboard/paste-line-endings-009-expected.txt
LayoutTests/editing/pasteboard/paste-text-002-expected.txt
LayoutTests/editing/pasteboard/paste-text-003-expected.checksum
LayoutTests/editing/pasteboard/paste-text-003-expected.png
LayoutTests/editing/pasteboard/paste-text-003-expected.txt
WebCore/ChangeLog
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h
WebCore/editing/Selection.h
WebCore/editing/htmlediting.cpp
WebCore/editing/htmlediting.h