Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2005 17:54:00 +0000 (17:54 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2005 17:54:00 +0000 (17:54 +0000)
commit9e52e146b115907e2155f7784b9ae3ddf89a3bd2
tree8788eeec340b479f97b2c869ba79d669b76a7955
parente6cbd35d1c307385d9ff32b39ec490fcf1ceedd4
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3980209> Mail crashed when I pressed Cmd-Shift-[ (nil-deref in ApplyStyleCommand::addBlockStyleIfNeeded)

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Reordered the new block
        insertion so that it come before the move. The logic stays exactly the same, however, with the old
        ordering, the new block could want to become a child of itself come insertion time. I considered
        making a more complicated code change to fix this problem, but the simple reordering works just
        as well, and seems less risky.

        These all changed in an insignificant way. It seems that with the new code, some empty text nodes
        got reordered in the document. This has no effect on anything visible to the user.

        * layout-tests/editing/style/create-block-for-style-003-expected.txt
        * layout-tests/editing/style/create-block-for-style-004-expected.txt
        * layout-tests/editing/style/create-block-for-style-009-expected.txt
        * layout-tests/editing/style/create-block-for-style-011-expected.txt
        * layout-tests/editing/style/create-block-for-style-013-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/editing/style/create-block-for-style-003-expected.txt
LayoutTests/editing/style/create-block-for-style-004-expected.txt
LayoutTests/editing/style/create-block-for-style-009-expected.txt
LayoutTests/editing/style/create-block-for-style-011-expected.txt
LayoutTests/editing/style/create-block-for-style-013-expected.txt
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp