LayoutTests:
Reviewed by darin
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8653>
Remove a use of hasMoreThanOneBlock
Deleting didn't merge because of code that stopped the merge whenever
the end of the selection to delete was in a fully selected line.
* editing/deleting/merge-endOfParagraph-expected.checksum: Added.
* editing/deleting/merge-endOfParagraph-expected.png: Added.
* editing/deleting/merge-endOfParagraph-expected.txt: Added.
* editing/deleting/merge-endOfParagraph.html: Added.
Two testcases where paste did not request a merge from deletion, but should have.
* editing/pasteboard/merge-after-delete-1-expected.checksum: Added.
* editing/pasteboard/merge-after-delete-1-expected.png: Added.
* editing/pasteboard/merge-after-delete-1-expected.txt: Added.
* editing/pasteboard/merge-after-delete-1.html: Added.
* editing/pasteboard/merge-after-delete-2-expected.checksum: Added.
* editing/pasteboard/merge-after-delete-2-expected.png: Added.
* editing/pasteboard/merge-after-delete-2-expected.txt: Added.
* editing/pasteboard/merge-after-delete-2.html: Added.
Code that prevents nesting incoming blocks in the block being pasted into
could reverse the order of pasted paragraphs.
* editing/pasteboard/prevent-block-nesting-01-expected.checksum: Added.
* editing/pasteboard/prevent-block-nesting-01-expected.png: Added.
* editing/pasteboard/prevent-block-nesting-01-expected.txt: Added.
* editing/pasteboard/prevent-block-nesting-01.html: Added.
WebCore:
Reviewed by darin
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8653>
Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::initializePositionData):
Removed code that stopped the merge if the end of the selection to delete
was in a fully selected line, which was nonsense.
(WebCore::DeleteSelectionCommand::mergeParagraphs):
Deletion does a bad job of updating the endpoints of the selection as it removes
content. If the endpoints have been flip flipped, bail.
If deletion has removed everything from the block that contained the
start of the selection to delete, we can't create a visible position inside
that block to serve as a destination for the merge. So, we insert a placeholder
at that position to prop the block open to let content in.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Added an assert and two early returns for cases where we'll crash.
Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info
and which was wrong.
If we've already inserted content during the start merge, insertionPos will be
the position just after that content, so inserting new content before insertionPos
will reverse its order.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14143
268f45cc-cd09-0410-ab3c-
d52691b4dbfc