LayoutTests:
Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8704>
Fix a few end merge bugs
<rdar://problem/
4424044>
REGRESSION: Extra line appears when typing
Added a function so that selection changes can participate in slow-motion-mode:
* editing/editing.js:
Extra newlines were added:
* editing/inserting/paragraph-separator-01-expected.checksum: Added.
* editing/inserting/paragraph-separator-01-expected.png: Added.
* editing/inserting/paragraph-separator-01-expected.txt: Added.
* editing/inserting/paragraph-separator-01.html: Added.
* editing/inserting/paragraph-separator-02-expected.checksum: Added.
* editing/inserting/paragraph-separator-02-expected.png: Added.
* editing/inserting/paragraph-separator-02-expected.txt: Added.
* editing/inserting/paragraph-separator-02.html: Added.
A preserved newline was turned into a nbsp:
* editing/inserting/paragraph-separator-03-expected.checksum: Added.
* editing/inserting/paragraph-separator-03-expected.png: Added.
* editing/inserting/paragraph-separator-03-expected.txt: Added.
* editing/inserting/paragraph-separator-03.html: Added.
End merge didn't happen:
* editing/pasteboard/merge-end-4-expected.checksum: Added.
* editing/pasteboard/merge-end-4-expected.png: Added.
* editing/pasteboard/merge-end-4-expected.txt: Added.
* editing/pasteboard/merge-end-4.html: Added.
Content was pulled out of these special elements:
* editing/pasteboard/merge-end-blockquote-expected.checksum: Added.
* editing/pasteboard/merge-end-blockquote-expected.png: Added.
* editing/pasteboard/merge-end-blockquote-expected.txt: Added.
* editing/pasteboard/merge-end-blockquote.html: Added.
* editing/pasteboard/merge-end-list-expected.checksum: Added.
* editing/pasteboard/merge-end-list-expected.png: Added.
* editing/pasteboard/merge-end-list-expected.txt: Added.
* editing/pasteboard/merge-end-list.html: Added.
* editing/pasteboard/merge-end-table-expected.checksum: Added.
* editing/pasteboard/merge-end-table-expected.png: Added.
* editing/pasteboard/merge-end-table-expected.txt: Added.
* editing/pasteboard/merge-end-table.html: Added.
WebCore:
Reviewed by harrison
<http://bugzilla.opendarwin.org/show_bug.cgi?id=8704>
Fix a few end merge bugs
<rdar://problem/
4424044>
REGRESSION: Extra line appears when typing
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
Use renamed characterAfter.
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
Regenerate a VisiblePosition that became stale during a text node split.
Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
newlines into nbsps, 2) I think it should only be done during serialization, not after
every command (since editable regions now always have -webkit-nbsp-mode:space on them).
Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
* editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
(WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
(WebCore::ReplaceSelectionCommand::doApply):
Call shouldMergeEnd after the insertion so that it can use rendering information.
Don't use positionAfterNode of the last node inserted to mark the position at the end
of inserted content because canonicalization can send it into content that was already
in the document.
* editing/ReplaceSelectionCommand.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::characterAfter):
Renamed. When two candidates are visually equivalent, the rightmost candidate will be
the one inside the text node where the character will be.
* editing/VisiblePosition.h:
* editing/htmlediting.cpp:
(WebCore::enclosingTableCell): Added.
(WebCore::enclosingList):
* editing/htmlediting.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14169
268f45cc-cd09-0410-ab3c-
d52691b4dbfc