WebCore:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2007 01:36:55 +0000 (01:36 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2007 01:36:55 +0000 (01:36 +0000)
commit32f408072f8dc2fbb589830a84fbb70b409f5165
tree5686cf2aadd9d8b27fc721a15f4b91fa04e69dd6
parent295fc13c5118d1a56ba765952793399bd1ae9d26
WebCore:

        Reviewed by Darin.

        <rdar://problem/5368833>
        REGRESSION: Pasting a triple-clicked line of quoted text at the top of a message adds an extra, quoted line

        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::insertParagraphSeparator): Added an option for
        using a plain div to hold the new paragraph, instead of a clone of the previous
        block.
        * editing/CompositeEditCommand.h:
        * editing/InsertParagraphSeparatorCommand.cpp: Ditto.
        (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): Ditto.
        (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
        * editing/InsertParagraphSeparatorCommand.h:
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Use a default block element when creating
        new paragraphs, so that empty paragraphs don't contain the block style of the previous
        one.
        Don't expand collapsed brs at the end of inserted content, this was the root of the bug.
        We'd copy <blockquote>hello<br></blockquote><br class="Apple-interchange-newline">
        and get an extra paragraph.  The removed code used to make sure that if the copied
        selection ends with a paragraph break that is represented in the copied markup by a
        regular br (not an interchange newline br), that that paragraph break appears in the
        pasted content, but shouldMergeEnd, which was introduced after this code was written,
        now takes care of that.
        (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Inserted content should always
        displace placeholder brs, even if that inserted content ends with a br.
        * editing/markup.cpp:
        (WebCore::needInterchangeNewlineAfter): This code failed to add an interchange newline
        if the user copied <div>hello</div><br>, only don't add an interchange newline when
        copying ^hello<br>^<br>, because then the copied paragraph break will already be
        represented in the copied markup by a br.
        (WebCore::createMarkup):

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/5368833>
        REGRESSION: Pasting a triple-clicked line of quoted text at the top of a message adds an extra, quoted line

        Tested for behavior that we no longer want to have:
        * editing/pasteboard/quirks-mode-br-2-expected.checksum: Removed.
        * editing/pasteboard/quirks-mode-br-2-expected.png: Removed.
        * editing/pasteboard/quirks-mode-br-2-expected.txt: Removed.
        * editing/pasteboard/quirks-mode-br-2.html: Removed.

        * platform/mac/editing/pasteboard: Added.

        Demonstrates bug:
        * editing/pasteboard/5368833.html: Added.
        * platform/mac/editing/pasteboard/5368833-expected.checksum: Added.
        * platform/mac/editing/pasteboard/5368833-expected.png: Added.
        * platform/mac/editing/pasteboard/5368833-expected.txt: Added.

        Regenerated these expected results to reflect new behavior:
        * editing/pasteboard/paste-text-012-expected.checksum: Removed.
        * editing/pasteboard/paste-text-012-expected.png: Removed.
        * editing/pasteboard/paste-text-012-expected.txt: Removed.
        * editing/pasteboard/paste-text-013-expected.checksum: Removed.
        * editing/pasteboard/paste-text-016-expected.checksum: Removed.
        * editing/pasteboard/paste-text-016-expected.png: Removed.
        * editing/pasteboard/paste-text-016-expected.txt: Removed.
        * platform/mac/editing/pasteboard/paste-text-012-expected.checksum: Added.
        * platform/mac/editing/pasteboard/paste-text-012-expected.png: Added.
        * platform/mac/editing/pasteboard/paste-text-012-expected.txt: Added.
        * platform/mac/editing/pasteboard/paste-text-013-expected.checksum: Added.
        * platform/mac/editing/pasteboard/paste-text-013-expected.png: Added.
        * platform/mac/editing/pasteboard/paste-text-013-expected.txt: Added.
        * platform/mac/editing/pasteboard/paste-text-016-expected.checksum: Added.
        * platform/mac/editing/pasteboard/paste-text-016-expected.png: Added.
        * platform/mac/editing/pasteboard/paste-text-016-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/5368833.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-text-012-expected.checksum [deleted file]
LayoutTests/editing/pasteboard/paste-text-013-expected.checksum [deleted file]
LayoutTests/editing/pasteboard/quirks-mode-br-2-expected.checksum [deleted file]
LayoutTests/editing/pasteboard/quirks-mode-br-2-expected.png [deleted file]
LayoutTests/editing/pasteboard/quirks-mode-br-2-expected.txt [deleted file]
LayoutTests/editing/pasteboard/quirks-mode-br-2.html [deleted file]
LayoutTests/platform/mac/editing/pasteboard/5368833-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/5368833-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/5368833-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-text-012-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-text-012-expected.png [moved from LayoutTests/editing/pasteboard/paste-text-012-expected.png with 96% similarity]
LayoutTests/platform/mac/editing/pasteboard/paste-text-012-expected.txt [moved from LayoutTests/editing/pasteboard/paste-text-012-expected.txt with 79% similarity]
LayoutTests/platform/mac/editing/pasteboard/paste-text-013-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-text-013-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-text-013-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-text-016-expected.checksum [moved from LayoutTests/editing/pasteboard/paste-text-016-expected.checksum with 100% similarity]
LayoutTests/platform/mac/editing/pasteboard/paste-text-016-expected.png [moved from LayoutTests/editing/pasteboard/paste-text-016-expected.png with 100% similarity]
LayoutTests/platform/mac/editing/pasteboard/paste-text-016-expected.txt [moved from LayoutTests/editing/pasteboard/paste-text-016-expected.txt with 92% similarity]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/CompositeEditCommand.h
WebCore/editing/InsertParagraphSeparatorCommand.cpp
WebCore/editing/InsertParagraphSeparatorCommand.h
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/markup.cpp