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