LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2006 21:17:47 +0000 (21:17 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2006 21:17:47 +0000 (21:17 +0000)
commit1a89717ca11ed58b558b06954f6005eef05cadaf
treee2a8c8ebe4a91f1aa895b61e62b9604d487eda29
parent1d9a548d233810b9108c83df4dcb1fc55faf89c6
LayoutTests:

        Reviewed by thatcher

        Added:
        * editing/pasteboard/interchange-newline-4-expected.checksum: Added.
        * editing/pasteboard/interchange-newline-4-expected.png: Added.
        * editing/pasteboard/interchange-newline-4-expected.txt: Added.
        * editing/pasteboard/interchange-newline-4.html: Added.
        * editing/deleting/paragraph-in-preserveNewline-expected.checksum: Added.
        * editing/deleting/paragraph-in-preserveNewline-expected.png: Added.
        * editing/deleting/paragraph-in-preserveNewline-expected.txt: Added.
        * editing/deleting/paragraph-in-preserveNewline.html: Added.

        Equivalent render trees, fixes, or bugs exposed (10427, 10428):
        * editing/execCommand/insertHTML-expected.checksum:
        * editing/execCommand/insertHTML-expected.png:
        * editing/execCommand/insertHTML-expected.txt:
        * editing/execCommand/insertHTML.html:
        * editing/execCommand/insertHorizontalRule-expected.checksum:
        * editing/execCommand/insertHorizontalRule-expected.png:
        * editing/execCommand/insertHorizontalRule-expected.txt:
        * editing/inserting/insert-3786362-fix-expected.checksum:
        * editing/inserting/insert-3786362-fix-expected.png:
        * editing/inserting/insert-3786362-fix-expected.txt:
        * editing/inserting/insert-3786362-fix.html:
        * editing/inserting/insert-3907422-fix-expected.txt:
        * editing/pasteboard/3976872-expected.checksum:
        * editing/pasteboard/3976872-expected.png:
        * editing/pasteboard/3976872-expected.txt:
        * editing/pasteboard/4076267-3-expected.checksum:
        * editing/pasteboard/4076267-3-expected.png:
        * editing/pasteboard/4076267-3-expected.txt:
        * editing/pasteboard/4076267-3.html:
        * editing/pasteboard/4076267-expected.checksum:
        * editing/pasteboard/4076267-expected.png:
        * editing/pasteboard/4076267-expected.txt:
        * editing/pasteboard/4076267.html:
        * editing/pasteboard/4242293-1-expected.txt:
        * editing/pasteboard/4242293-expected.checksum:
        * editing/pasteboard/4242293-expected.png:
        * editing/pasteboard/4242293-expected.txt:
        * editing/pasteboard/4631972-expected.txt:
        * editing/pasteboard/8145-1-expected.txt:
        * editing/pasteboard/8145-3-expected.txt:
        * editing/pasteboard/block-wrappers-necessary-expected.txt:
        * editing/pasteboard/copy-paste-bidi-expected.txt:
        * editing/pasteboard/display-block-on-spans-expected.checksum:
        * editing/pasteboard/display-block-on-spans-expected.png:
        * editing/pasteboard/display-block-on-spans-expected.txt:
        * editing/pasteboard/interchange-newline-1-expected.txt:
        * editing/pasteboard/merge-end-1-expected.checksum:
        * editing/pasteboard/merge-end-1-expected.png:
        * editing/pasteboard/merge-end-1-expected.txt:
        * editing/pasteboard/merge-end-1.html:
        * editing/pasteboard/merge-end-2-expected.checksum:
        * editing/pasteboard/merge-end-2-expected.png:
        * editing/pasteboard/merge-end-2-expected.txt:
        * editing/pasteboard/merge-end-2.html:
        * editing/pasteboard/merge-end-4-expected.txt:
        * editing/pasteboard/merge-end-list-expected.txt:
        * editing/pasteboard/merge-end-table-expected.checksum:
        * editing/pasteboard/merge-end-table-expected.png:
        * editing/pasteboard/merge-end-table-expected.txt:
        * editing/pasteboard/nested-blocks-with-text-area-expected.txt:
        * editing/pasteboard/nested-blocks-with-text-field-expected.txt:
        * editing/pasteboard/paste-4039777-fix-expected.checksum:
        * editing/pasteboard/paste-4039777-fix-expected.png:
        * editing/pasteboard/paste-4039777-fix-expected.txt:
        * editing/pasteboard/paste-line-endings-002-expected.txt:
        * editing/pasteboard/paste-line-endings-004-expected.txt:
        * 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-match-style-002-expected.txt:
        * editing/pasteboard/paste-pre-001-expected.txt:
        * editing/pasteboard/paste-pre-002-expected.txt:
        * editing/pasteboard/paste-table-001-expected.checksum:
        * editing/pasteboard/paste-table-001-expected.png:
        * editing/pasteboard/paste-table-001-expected.txt:
        * editing/pasteboard/paste-table-003-expected.txt:
        * editing/pasteboard/paste-text-001-expected.txt:
        * editing/pasteboard/paste-text-003-expected.txt:
        * editing/pasteboard/paste-text-007-expected.checksum:
        * editing/pasteboard/paste-text-007-expected.png:
        * editing/pasteboard/paste-text-007-expected.txt:
        * editing/pasteboard/paste-text-008-expected.txt:
        * editing/pasteboard/paste-text-009-expected.txt:
        * editing/pasteboard/paste-text-010-expected.txt:
        * editing/pasteboard/paste-text-011-expected.txt:
        * 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-013-expected.checksum:
        * editing/pasteboard/paste-text-013-expected.png:
        * editing/pasteboard/paste-text-013-expected.txt:
        * editing/pasteboard/paste-text-015-expected.txt:
        * editing/pasteboard/paste-text-017-expected.txt:
        * editing/pasteboard/paste-text-019-expected.checksum:
        * editing/pasteboard/paste-text-019-expected.png:
        * editing/pasteboard/paste-text-019-expected.txt:
        * editing/pasteboard/paste-text-019.html:
        * editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
        * editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
        * editing/pasteboard/paste-text-at-tabspan-003-expected.txt:
        * editing/pasteboard/pasting-object-expected.txt:
        * editing/pasteboard/prevent-block-nesting-01-expected.txt:
        * editing/pasteboard/quirks-mode-br-1-expected.txt:
        * editing/pasteboard/smart-paste-001-expected.txt:
        * editing/pasteboard/smart-paste-002-expected.txt:
        * editing/pasteboard/smart-paste-003-expected.txt:
        * editing/pasteboard/smart-paste-004-expected.txt:
        * editing/pasteboard/smart-paste-005-expected.txt:
        * editing/pasteboard/smart-paste-006-expected.txt:
        * editing/pasteboard/smart-paste-007-expected.txt:
        * editing/pasteboard/smart-paste-008-expected.txt:
        * editing/pasteboard/undoable-fragment-removes-expected.checksum:
        * editing/pasteboard/undoable-fragment-removes-expected.png:
        * editing/pasteboard/undoable-fragment-removes-expected.txt:
        * editing/pasteboard/undoable-fragment-removes.html:
        * editing/style/smoosh-styles-001-expected.txt:
        * editing/style/smoosh-styles-002-expected.txt:

WebCore:

        Reviewed by thatcher

        First part of fix for:
        <rdar://problem/4384589>
        Mail hung on paste text

        Fixes:
        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8592>
        Extra line left after deleting whitespace:pre text
        <rdar://problem/4128080> Paste as HTML does not yield equivalent style
        <rdar://problem/4046469> Box styles on first element aren't copied/pasted
        Copy/paste of arstechnica.com

        Here's how we avoid adding redundant style information on paste: insert
        the fragment and do a test rendering, save away style information for
        every node in the fragment, remove all style information from the fragment,
        remove the fragment, insert it into the appropriate place in the document,
        then restore only those styles gathered during the test insertion that aren't
        redundant.  Restoring the styles in this way results in an ApplyStyleCommand
        and a layout for nearly every inserted node.
        Instead we want to insert the fragment into the document without removing the
        style information, then mark style nodes and inline style declarations for
        removal if they are redundant, and sweep to remove them.  This means that we
        can't rely on ReplacementFragment::wasBlock anymore, because blocks will now
        have style spans around them.  This patch removes the use of wasBlock in
        ReplaceSelectionCommand.

        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphs): Added code
        to remove the line placeholder left after a move from preserveNewline text.
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::doApply): Don't add a placeholder if
        we're deleting a paragraph in preserveNewline text.
        * editing/JSEditor.cpp: Pass true to prevent nesting.
        * editing/ReplaceSelectionCommand.cpp: Removed wasBlock and friends.
        (WebCore::ReplacementFragment::ReplacementFragment): Ditto.
        (WebCore::ReplacementFragment::saveRenderingInfo): Ditto.
        (WebCore::RenderingInfo::RenderingInfo): Ditto.
        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
        (WebCore::ReplaceSelectionCommand::shouldMergeStart): Combined the to/from
        merging rules into one method.
        (WebCore::ReplaceSelectionCommand::shouldMergeEnd):
        (WebCore::ReplaceSelectionCommand::shouldMerge):
        (WebCore::ReplaceSelectionCommand::doApply):
        Don't do nesting prevention when pasting into an empty paragraph, this
        fixes 4046469, the common cause of paste fidelity bugs, but needs
        to be tweaked a little because this can lead to margin/border build-up
        on repeated copy/pastes.
        Don't track startPos in addition to insertionPos.  It was never used.
        Fixed a bug where a fragment starting with an interchange newline would
        cause content to be put outside of an editable region when pasting at the
        very end of it.
        Adjust insertionPos before insertion (not during) and do not consult wasBlock
        to decide whether or not to do so.
        Changed the way we do the start merge: insert the fragment, then stich
        paragraphs together, in the same way that we do the end merge.  This
        doesn't require wasBlock and fixes bugs.
        Replaced some uses of insertionPos with endOfInsertedContent.
        Fixed a bug in the expansion of the last incoming br (a "collapsed" br
        is one where !isStartOfParagraph([br,0])).
        Removed the special case code that did the end merge for the preserveNewline
        case, since this patch fixes the moveParagraph bug in the preserveNewline case.
        Removed some unused variables.
        (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): An endBR that was
        holding a line open should always be displaced by inserted content, unless
        the inserted content ends with a br.
        (WebCore::ReplaceSelectionCommand::updateNodesInserted):
        * editing/ReplaceSelectionCommand.h:
        (WebCore::RenderingInfo::style):
        * editing/markup.cpp:
        (WebCore::createMarkup): Only add mail blockquotes and list/table/pre when
        annotate is true (when we're creating markup for the pasteboard).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
122 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.checksum [new file with mode: 0644]
LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.png [new file with mode: 0644]
LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/paragraph-in-preserveNewline.html [new file with mode: 0644]
LayoutTests/editing/execCommand/insertHTML-expected.checksum
LayoutTests/editing/execCommand/insertHTML-expected.png
LayoutTests/editing/execCommand/insertHTML-expected.txt
LayoutTests/editing/execCommand/insertHTML.html
LayoutTests/editing/execCommand/insertHorizontalRule-expected.checksum
LayoutTests/editing/execCommand/insertHorizontalRule-expected.png
LayoutTests/editing/execCommand/insertHorizontalRule-expected.txt
LayoutTests/editing/inserting/insert-3786362-fix-expected.checksum
LayoutTests/editing/inserting/insert-3786362-fix-expected.png
LayoutTests/editing/inserting/insert-3786362-fix-expected.txt
LayoutTests/editing/inserting/insert-3786362-fix.html
LayoutTests/editing/inserting/insert-3907422-fix-expected.txt
LayoutTests/editing/pasteboard/3976872-expected.checksum
LayoutTests/editing/pasteboard/3976872-expected.png
LayoutTests/editing/pasteboard/3976872-expected.txt
LayoutTests/editing/pasteboard/4076267-3-expected.checksum
LayoutTests/editing/pasteboard/4076267-3-expected.png
LayoutTests/editing/pasteboard/4076267-3-expected.txt
LayoutTests/editing/pasteboard/4076267-3.html
LayoutTests/editing/pasteboard/4076267-expected.checksum
LayoutTests/editing/pasteboard/4076267-expected.png
LayoutTests/editing/pasteboard/4076267-expected.txt
LayoutTests/editing/pasteboard/4076267.html
LayoutTests/editing/pasteboard/4242293-1-expected.txt
LayoutTests/editing/pasteboard/4242293-expected.checksum
LayoutTests/editing/pasteboard/4242293-expected.png
LayoutTests/editing/pasteboard/4242293-expected.txt
LayoutTests/editing/pasteboard/4631972-expected.txt
LayoutTests/editing/pasteboard/8145-1-expected.txt
LayoutTests/editing/pasteboard/8145-3-expected.txt
LayoutTests/editing/pasteboard/block-wrappers-necessary-expected.txt
LayoutTests/editing/pasteboard/copy-paste-bidi-expected.txt
LayoutTests/editing/pasteboard/display-block-on-spans-expected.checksum
LayoutTests/editing/pasteboard/display-block-on-spans-expected.png
LayoutTests/editing/pasteboard/display-block-on-spans-expected.txt
LayoutTests/editing/pasteboard/interchange-newline-1-expected.txt
LayoutTests/editing/pasteboard/interchange-newline-4-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/interchange-newline-4-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/interchange-newline-4-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/interchange-newline-4.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-end-1-expected.checksum
LayoutTests/editing/pasteboard/merge-end-1-expected.png
LayoutTests/editing/pasteboard/merge-end-1-expected.txt
LayoutTests/editing/pasteboard/merge-end-1.html
LayoutTests/editing/pasteboard/merge-end-2-expected.checksum
LayoutTests/editing/pasteboard/merge-end-2-expected.png
LayoutTests/editing/pasteboard/merge-end-2-expected.txt
LayoutTests/editing/pasteboard/merge-end-2.html
LayoutTests/editing/pasteboard/merge-end-4-expected.txt
LayoutTests/editing/pasteboard/merge-end-list-expected.txt
LayoutTests/editing/pasteboard/merge-end-table-expected.checksum
LayoutTests/editing/pasteboard/merge-end-table-expected.png
LayoutTests/editing/pasteboard/merge-end-table-expected.txt
LayoutTests/editing/pasteboard/nested-blocks-with-text-area-expected.txt
LayoutTests/editing/pasteboard/nested-blocks-with-text-field-expected.txt
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.checksum
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.png
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.txt
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-match-style-002-expected.txt
LayoutTests/editing/pasteboard/paste-pre-001-expected.txt
LayoutTests/editing/pasteboard/paste-pre-002-expected.txt
LayoutTests/editing/pasteboard/paste-table-001-expected.checksum
LayoutTests/editing/pasteboard/paste-table-001-expected.png
LayoutTests/editing/pasteboard/paste-table-001-expected.txt
LayoutTests/editing/pasteboard/paste-table-003-expected.txt
LayoutTests/editing/pasteboard/paste-text-001-expected.txt
LayoutTests/editing/pasteboard/paste-text-003-expected.txt
LayoutTests/editing/pasteboard/paste-text-007-expected.checksum
LayoutTests/editing/pasteboard/paste-text-007-expected.png
LayoutTests/editing/pasteboard/paste-text-007-expected.txt
LayoutTests/editing/pasteboard/paste-text-008-expected.txt
LayoutTests/editing/pasteboard/paste-text-009-expected.txt
LayoutTests/editing/pasteboard/paste-text-010-expected.txt
LayoutTests/editing/pasteboard/paste-text-011-expected.txt
LayoutTests/editing/pasteboard/paste-text-012-expected.checksum
LayoutTests/editing/pasteboard/paste-text-012-expected.png
LayoutTests/editing/pasteboard/paste-text-012-expected.txt
LayoutTests/editing/pasteboard/paste-text-012.html
LayoutTests/editing/pasteboard/paste-text-013-expected.checksum
LayoutTests/editing/pasteboard/paste-text-013-expected.png
LayoutTests/editing/pasteboard/paste-text-013-expected.txt
LayoutTests/editing/pasteboard/paste-text-015-expected.txt
LayoutTests/editing/pasteboard/paste-text-017-expected.txt
LayoutTests/editing/pasteboard/paste-text-019-expected.checksum
LayoutTests/editing/pasteboard/paste-text-019-expected.png
LayoutTests/editing/pasteboard/paste-text-019-expected.txt
LayoutTests/editing/pasteboard/paste-text-019.html
LayoutTests/editing/pasteboard/paste-text-at-tabspan-001-expected.txt
LayoutTests/editing/pasteboard/paste-text-at-tabspan-002-expected.txt
LayoutTests/editing/pasteboard/paste-text-at-tabspan-003-expected.txt
LayoutTests/editing/pasteboard/pasting-object-expected.txt
LayoutTests/editing/pasteboard/prevent-block-nesting-01-expected.txt
LayoutTests/editing/pasteboard/quirks-mode-br-1-expected.txt
LayoutTests/editing/pasteboard/smart-paste-001-expected.txt
LayoutTests/editing/pasteboard/smart-paste-002-expected.txt
LayoutTests/editing/pasteboard/smart-paste-003-expected.txt
LayoutTests/editing/pasteboard/smart-paste-004-expected.txt
LayoutTests/editing/pasteboard/smart-paste-005-expected.txt
LayoutTests/editing/pasteboard/smart-paste-006-expected.txt
LayoutTests/editing/pasteboard/smart-paste-007-expected.txt
LayoutTests/editing/pasteboard/smart-paste-008-expected.txt
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.checksum
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.png
LayoutTests/editing/pasteboard/undoable-fragment-removes-expected.txt
LayoutTests/editing/pasteboard/undoable-fragment-removes.html
LayoutTests/editing/style/smoosh-styles-001-expected.txt
LayoutTests/editing/style/smoosh-styles-002-expected.txt
WebCore/ChangeLog
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/DeleteSelectionCommand.cpp
WebCore/editing/JSEditor.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h
WebCore/editing/markup.cpp