LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Nov 2006 01:56:24 +0000 (01:56 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Nov 2006 01:56:24 +0000 (01:56 +0000)
commit4c36c30b21d7998d1cf6c6b3d49a4f0acbb16768
tree5b37cf1e69825b491aa3ab11bb05b846d646e141
parent2f4f5fb89016101198d54be468efa6332428baf4
LayoutTests:

        Reviewed by harrison

        <rdar://problem/4069359>
        Deleting hyperlink text, then typing uses link typing style but loses the link itself

        * editing/deleting/delete-link-1-expected.checksum: Added.
        * editing/deleting/delete-link-1-expected.png: Added.
        * editing/deleting/delete-link-1-expected.txt: Added.
        * editing/deleting/delete-link-1.html: Added.
        * editing/inserting/insert-before-link-1-expected.checksum: Added.
        * editing/inserting/insert-before-link-1-expected.png: Added.
        * editing/inserting/insert-before-link-1-expected.txt: Added.
        * editing/inserting/insert-before-link-1.html: Added.

WebCore:

        Reviewed by harrison

        <rdar://problem/4069359>
        Deleting hyperlink text, then typing uses link typing style but loses the link itself

        The removed anchor element needs to stick around temporarily, in the same way
        that the typing style hangs off the caret until the user moves it.  Also text
        insertion around anchors didn't match TextEdit.

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor): Added.
        (WebCore::DeleteSelectionCommand::doApply): Call saveFullySelectedAnchor.
        * editing/DeleteSelectionCommand.h:
        * editing/EditCommand.cpp:
        (WebCore::EditCommand::apply): Clear the removed anchor after any top level
        editing command that doesn't preserve the typing style (matches TextEdit).
        * editing/Editor.cpp:
        (WebCore::Editor::appliedEditing): Added a fixme: we shouldn't call
        setSelection with a message telling it to clear the typing style
        (and the saved anchor) here.  Save/restore the saved anchor because of this.
        * editing/Editor.h:
        (WebCore::Editor::removedAnchor): Getter.
        (WebCore::Editor::setRemovedAnchor): Setter.
        * editing/InsertTextCommand.cpp:
        (WebCore::InsertTextCommand::prepareForTextInsertion): Insert the saved anchor
        if one exists.
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::setSelection): Clear the removed anchor whenever
        we make a selection change that clears the typing style.
        (WebCore::SelectionController::nodeWillBeRemoved): Removed an old outdated FIXME.
        * editing/htmlediting.cpp:
        (WebCore::positionAvoidingSpecialElementBoundary): Cleaned up and
        made some changes to match TextEdit's behavior.  First, insert content
        inside the anchor when the caret is after it, unless the caret is at the
        end of the document, or if the caret is before it and at the start of a
        paragraph.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-link-1-expected.checksum [new file with mode: 0644]
LayoutTests/editing/deleting/delete-link-1-expected.png [new file with mode: 0644]
LayoutTests/editing/deleting/delete-link-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-link-1.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-before-link-1-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/insert-before-link-1-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/insert-before-link-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-before-link-1.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/DeleteSelectionCommand.cpp
WebCore/editing/DeleteSelectionCommand.h
WebCore/editing/EditCommand.cpp
WebCore/editing/Editor.cpp
WebCore/editing/Editor.h
WebCore/editing/InsertTextCommand.cpp
WebCore/editing/SelectionController.cpp
WebCore/editing/htmlediting.cpp
WebCore/editing/htmlediting.h