2011-05-19 Ryosuke Niwa <rniwa@webkit.org>
authorRyosuke Niwa <rniwa@webkit.org>
Thu, 19 May 2011 17:22:24 +0000 (17:22 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Thu, 19 May 2011 20:28:11 +0000 (17:28 -0300)
commit66e7630c7f132bf6979402dd23cd4b052bd02a09
treef91a309c4bbc45d3b77973b01fde27d3b89ee48b
parentf46a0689c3ce5b01db016d6c0815cf0dad87fe98
2011-05-19  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Darin Adler.

        REGRESSION (r83322): Many crashes in Mail.app in WebCore::Node::nodeIndex
        https://bugs.webkit.org/show_bug.cgi?id=61012

        Added a test to ensure WebKit does not crash when inserting a content immediately after
        a styled element inside a Mail blockquote. Regrettably the expected result is incorrect,
        but it matches the behavior of WebKit before r83322.

        * editing/pasteboard/5065605-expected.txt: Reintroduced redundant style spans.
        * editing/pasteboard/paste-text-011-expected.txt: Ditto.
        * platform/chromium-win/editing/pasteboard/paste-text-011-expected.txt: Ditto.
        * editing/pasteboard/paste-after-inline-style-element-expected.txt: Added.
        * editing/pasteboard/paste-after-inline-style-element.html: Added.
2011-05-19  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Darin Adler.

        REGRESSION (r83322): Many crashes in Mail.app in WebCore::Node::nodeIndex
        https://bugs.webkit.org/show_bug.cgi?id=61012

        The crash was caused by ReplaceSelectionCommand's inserting content into a middle of the paragraph
        being moved when the insertion position's container node is the node to split to. Fixed the crash
        by not changing the insertion position in such a case.

        Unfortunately, this fix caused markup to bloat in some tests but we'll take this regression since
        it's much better than crashing.

        Test: editing/pasteboard/paste-after-inline-style-element.html

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/5065605-expected.txt
LayoutTests/editing/pasteboard/paste-after-inline-style-element-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-after-inline-style-element.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-text-011-expected.txt
LayoutTests/platform/chromium-win/editing/pasteboard/paste-text-011-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/editing/ReplaceSelectionCommand.cpp