Reviewed by harrison
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2005 07:47:09 +0000 (07:47 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2005 07:47:09 +0000 (07:47 +0000)
commitb0660df8e057ed223f6c87a85563b2eda389e4ac
tree493059c335d21c979f1cfadbcaf8c8aa9ec52477
parent70c68a59597de760a5decd5b094d67a6fcda0227
    Reviewed by harrison

        <rdar://problem/4278698> Adding a space inside whitespace:pre text collapses space
        <rdar://problem/4076267> Mail behaves oddly when pasting in text with leading/trailing whitespace
        <rdar://problem/4063751> Redo Typing can add extra space characters
        <rdar://problem/4120558> Mail/WebKit: Repeated capitalizeWord command deletes spaces and does not capitalize

        Reblance whitespace was finding the extent of surrounding whitespace incorrectly.
        createFragmentFromMarkup was not dealing with the special cases for spaces at the start/end
        of a line.  InsertTextCommand was removing collapsable whitespace without regard for the
        whitespace mode.  createFragmentFromMarkup and RebalanceWhitespace command now use one method
        to produce rebalanced sequences.  Removed special case whitespace handling from
        InsertTextCommand, that's RebalanceWhiteSpaceCommand's job.

        Test cases added:
        * layout-tests/editing/inserting/4278698.html: Added.
        * layout-tests/editing/pasteboard/4076267-2.html: Added.
        * layout-tests/editing/pasteboard/4076267-3.html: Added.
        * layout-tests/editing/pasteboard/4076267.html: Added.
        * layout-tests/editing/undo/4063751.html: Added.

        * khtml/editing/composite_edit_command.cpp:
        (khtml::CompositeEditCommand::rebalanceWhitespaceAt):
        Added.  The old convenience method, rebalanceWhitespace, can probably
        be removed, because there is never a non-caret selection after an editing command.
        * khtml/editing/composite_edit_command.h:
        * khtml/editing/htmlediting.cpp:
        (khtml::rebalanceWhitespaceInTextNode):
        * khtml/editing/htmlediting.h:
        * khtml/editing/insert_text_command.cpp:
        (khtml::InsertTextCommand::input):
        * khtml/editing/insert_text_command.h:
        * khtml/editing/markup.cpp:
        (khtml::createParagraphContentsFromString):
        (khtml::createFragmentFromText):
        * khtml/editing/rebalance_whitespace_command.cpp:
        (khtml::RebalanceWhitespaceCommand::RebalanceWhitespaceCommand):
        (khtml::isWhitespace): Changed from isNBSP to include all forms of whitespace, to aid readability.
        (khtml::RebalanceWhitespaceCommand::doApply):
        (khtml::RebalanceWhitespaceCommand::doUnapply): Removed the unused m_downstreamOffset
        * layout-tests/editing/editingStyle.css: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/editing/editingStyle.css [new file with mode: 0644]
LayoutTests/editing/inserting/4278698-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/4278698.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-2-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-2.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-3-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-3.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267.html [new file with mode: 0644]
LayoutTests/editing/undo/4063751-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/4063751.html [new file with mode: 0644]
WebCore/ChangeLog-2005-12-19
WebCore/khtml/editing/composite_edit_command.cpp
WebCore/khtml/editing/composite_edit_command.h
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h
WebCore/khtml/editing/insert_text_command.cpp
WebCore/khtml/editing/insert_text_command.h
WebCore/khtml/editing/markup.cpp
WebCore/khtml/editing/rebalance_whitespace_command.cpp