LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2006 18:41:26 +0000 (18:41 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2006 18:41:26 +0000 (18:41 +0000)
commit55b54bd94de3a5cf7eeeae9ce628570e5299daed
tree119b57ab98ac1b24c45d877c009af4ac036e5312
parent8fb39eed0c6ec2ae50f386ac2727fa244c7fd2b4
LayoutTests:

        Reviewed by harrison

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8145>
        REGRESSION: Pasting text from TextEdit with a bold word into text field results in crash

        * editing/pasteboard/8145-1-expected.checksum: Added.
        * editing/pasteboard/8145-1-expected.png: Added.
        * editing/pasteboard/8145-1-expected.txt: Added.
        * editing/pasteboard/8145-1.html: Added.
        * editing/pasteboard/8145-2-expected.checksum: Added.
        * editing/pasteboard/8145-2-expected.png: Added.
        * editing/pasteboard/8145-2-expected.txt: Added.
        * editing/pasteboard/8145-2.html: Added.
        * editing/pasteboard/8145-3-expected.checksum: Added.
        * editing/pasteboard/8145-3-expected.png: Added.
        * editing/pasteboard/8145-3-expected.txt: Added.
        * editing/pasteboard/8145-3.html: Added.
        * fast/forms/plaintext-mode-1-expected.txt:
        * fast/forms/plaintext-mode-1.html:

WebCore:

        Reviewed by harrison

        <http://bugzilla.opendarwin.org/show_bug.cgi?id=8145>
        REGRESSION: Pasting text from TextEdit with a bold word into text field results in crash

        * editing/AppendNodeCommand.cpp:
        (WebCore::AppendNodeCommand::doApply):
        Assert that the node will be placed somewhere that's contenteditable.
        * editing/InsertNodeBeforeCommand.cpp:
        (WebCore::InsertNodeBeforeCommand::doApply): Ditto
        * editing/JSEditor.cpp:
        Enabled insertHTML for plaintext-only regions since it's useful for debugging rich
        content pastes into the new text fields.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply):
        1) After the first paragraph of the fragment has been merged with the first part of the
        paragraph where the paste occured, if the next node to be inserted is inline, we put it
        in a new paragraph because it was at the start of a paragraph in the fragment.  The change
        is to insert a paragraph separator if insertionPos.next() is null or outside of the current
        editable region.
        2) Before the paste begins, a paragraph separator is inserted in order to avoid
        nesting blocks from the fragment to be pasted inside the block where the paste will
        occur.  I made two fixes to the code that decides whether or not to insert the
        paragraph separator and added testcases for each.  Added a fixme because it appears that
        this code is also used to ensure that the aforementioned insertionPos will be at the end of
        a paragraph.  This code should only be about preventing nesting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/8145-1-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-1-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-1.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-2-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-2-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-2-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-2.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-3-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-3-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-3-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/8145-3.html [new file with mode: 0644]
LayoutTests/fast/forms/plaintext-mode-1-expected.txt
LayoutTests/fast/forms/plaintext-mode-1.html
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/AppendNodeCommand.cpp
WebCore/editing/InsertNodeBeforeCommand.cpp
WebCore/editing/JSEditor.cpp
WebCore/editing/ReplaceSelectionCommand.cpp