LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2007 00:29:36 +0000 (00:29 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2007 00:29:36 +0000 (00:29 +0000)
commitf71b7d3cdd4a444c2180c4285debde97dafccc8b
tree72cb1e148366aafb9d0bac82c98b23855ae399c0
parent3952ab30f6c838f13112ab5e6bff3f940ef190d2
LayoutTests:

        Reviewed by Harrison.

        <rdar://problem/5378473> Undoing a deletion that is part of an open typing command fails to reinsert the caret

        * editing/undo/5378473.html: Added.
        * platform/mac/editing: Added.
        * platform/mac/editing/undo: Added.
        * platform/mac/editing/undo/5378473-expected.checksum: Added.
        * platform/mac/editing/undo/5378473-expected.png: Added.
        * platform/mac/editing/undo/5378473-expected.txt: Added.

WebCore:

        Reviewed by Harrison.

        <rdar://problem/5378473>
        REGRESSION: Undoing a deletion that is part of an open typing command fails to reinsert the caret

        We recently made Undo of a series of deletes select all of the
        characters that were deleted, not just the most recently deleted
        character.  But the code that did this set a new starting selection
        after every delete, even those that were part of an open typing
        command that started with character insertions or forward deletes,
        operations that when undone, remove the starting selection being
        set from the document.

        After this change we only set a new starting selection if the open typing
        command was opened by a backward delete. The new behavior matches TextEdit.
        We don't do something similar or forward deletes because TextEdit opens
        and closes a new typing command on forward delete (added a FIXME about this).

        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::TypingCommand): Initialize
        m_openedByBackwardDelete.
        (WebCore::TypingCommand::forwardDeleteKeyPressed): Added a FIXME about
        how in TextEdit, forward deletes open and close a new typing command.
        (WebCore::TypingCommand::doApply): Set m_openedByBackwardDelete
        appropriately.
        (WebCore::TypingCommand::deleteKeyPressed): Only set the starting
        selection if this delete is the first one in an open typing command
        or one in a series of deletes that opened the typing command.
        * editing/TypingCommand.h: Added m_openedByBackwardDelete.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/undo/5378473.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/undo/5378473-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/undo/5378473-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/undo/5378473-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/TypingCommand.cpp
WebCore/editing/TypingCommand.h