Reviewed by Darin
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jan 2005 18:47:43 +0000 (18:47 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jan 2005 18:47:43 +0000 (18:47 +0000)
commit2d150df089214f399a576e52617f001fd19f0fad
tree6c561cc4543fadd709d6725f3273cab1edcafdcd
parente334c13c1348d843e49c08fb5736b60a115a8a1e
    Reviewed by Darin

        Fix for this bug:

        <rdar://problem/3907005> Applying block styles to a line of text can unexpectedly affect other lines

        * khtml/editing/htmlediting.cpp:
        (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): New function which moves "paragraphs"
        to their own blocks if needed so that a block style can be applied.
        (khtml::CompositeEditCommand::isMailBlockquote): Moved this function to base class so it can be used more generally.
        (khtml::ApplyStyleCommand::applyBlockStyle): Pass a node instead of a block to addBlockStyleIfNeeded().
        (khtml::ApplyStyleCommand::addBlockStyleIfNeeded): Now accepts a node instead of a block for styling.
        This function also now calls moveParagraphContentsToNewBlockIfNecessary() to make sure that only the current
        paragraph is styled.
        (khtml::SetNodeAttributeCommand::doUnapply): Should not assert on undo if old value of attribute was null.
        Should remove attributue instead.
        * khtml/editing/htmlediting.h: Touch function declarations accordingly.
        * layout-tests/editing/style/create-block-for-style-001-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-001.html: Added.
        * layout-tests/editing/style/create-block-for-style-002-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-002.html: Added.
        * layout-tests/editing/style/create-block-for-style-003-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-003.html: Added.
        * layout-tests/editing/style/create-block-for-style-004-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-004.html: Added.
        * layout-tests/editing/style/create-block-for-style-005-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-005.html: Added.
        * layout-tests/editing/style/create-block-for-style-006-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-006.html: Added.
        * layout-tests/editing/style/create-block-for-style-007-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-007.html: Added.
        * layout-tests/editing/style/create-block-for-style-008-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-008.html: Added.
        * layout-tests/editing/style/create-block-for-style-009-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-009.html: Added.
        * layout-tests/editing/style/create-block-for-style-010-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-010.html: Added.
        * layout-tests/editing/style/create-block-for-style-011-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-011.html: Added.
        * layout-tests/editing/style/create-block-for-style-012-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-012.html: Added.
        * layout-tests/editing/style/create-block-for-style-013-expected.txt: Added.
        * layout-tests/editing/style/create-block-for-style-013.html: Added.

        Unrelated updates to these expected results.
        * layout-tests/editing/inserting/insert-div-007-expected.txt
        * layout-tests/editing/pasteboard/paste-text-013-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
LayoutTests/editing/inserting/insert-div-007-expected.txt
LayoutTests/editing/pasteboard/paste-text-013-expected.txt
LayoutTests/editing/style/create-block-for-style-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-001.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-002.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-003.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-004.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-005.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-006-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-006.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-007-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-007.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-008-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-008.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-009-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-009.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-010-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-010.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-011-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-011.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-012-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-012.html [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-013-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/create-block-for-style-013.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h