WebCore:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2007 01:03:00 +0000 (01:03 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Sep 2007 01:03:00 +0000 (01:03 +0000)
commit82c68b6fe7b31f096a30916043f920e864b2b85e
treeb99375ecdb0eb09e80b93371f516d3e5b900e2f6
parent902e1434ea9f69c25b6e961499d447bf8eb6c738
WebCore:

        Reviewed by Kevin and Tristan.

        Tests added:
        * editing/pasteboard/paste-into-anchor-text.html: Added.
        * editing/pasteboard/paste-table-cells.html: Added.

        Source changes:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
        Nil check enclosingAnchor.

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeNodeAndPruneAncestors):
        New. Keeps m_firstNodeInserted and m_lastLeafInserted updated.

        (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
        Added a comment.

        (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
        Let ReplaceSelectionCommand::removeNodeAndPruneAncestors() update the nodes.

        (WebCore::ReplaceSelectionCommand::doApply):
        Pass originalVisPosBeforeEndBR to shouldRemoveEndBR()

        (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR):
        Don't remove the br if nothing was inserted.

        * editing/ReplaceSelectionCommand.h:
        Add VisiblePosition parameter to shouldRemoveEndBR()

        * editing/markup.cpp:
        (WebCore::createMarkup):
        Wrap orphan tr element with a table element, just like we were doing
        for tobody elements.

LayoutTests:

        Reviewed by Kevin and Tristan.

        <rdar://problem/5456800> Mail crashes at WebCore::nextCandidate() after pasting back into a <table> multiple times

        * editing/pasteboard/paste-into-anchor-text.html: Added.
        * editing/pasteboard/paste-table-cells.html: Added.
        * editing/pasteboard/quirks-mode-br-1-expected.checksum:
        * editing/pasteboard/quirks-mode-br-1-expected.txt:
        * editing/pasteboard/quirks-mode-br-1.html:
        * platform/mac/editing/pasteboard/paste-into-anchor-text-expected.checksum: Added.
        * platform/mac/editing/pasteboard/paste-into-anchor-text-expected.png: Added.
        * platform/mac/editing/pasteboard/paste-into-anchor-text-expected.txt: Added.
        * platform/mac/editing/pasteboard/paste-table-cells-expected.checksum: Added.
        * platform/mac/editing/pasteboard/paste-table-cells-expected.png: Added.
        * platform/mac/editing/pasteboard/paste-table-cells-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/paste-into-anchor-text.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-table-cells.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/quirks-mode-br-1-expected.checksum
LayoutTests/editing/pasteboard/quirks-mode-br-1-expected.txt
LayoutTests/editing/pasteboard/quirks-mode-br-1.html
LayoutTests/platform/mac/editing/pasteboard/paste-into-anchor-text-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-into-anchor-text-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-into-anchor-text-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-table-cells-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-table-cells-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/pasteboard/paste-table-cells-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h
WebCore/editing/markup.cpp