LayoutTests:
Reviewed by levi
<http://bugzilla.opendarwin.org/show_bug.cgi?id=4468>
Implement execCommand(Insert{Un}OrderedList)
Added:
* editing/execCommand/create-list-from-range-selection-expected.checksum: Added.
* editing/execCommand/create-list-from-range-selection-expected.png: Added.
* editing/execCommand/create-list-from-range-selection-expected.txt: Added.
* editing/execCommand/create-list-from-range-selection.html: Added.
* editing/execCommand/insert-list-and-stitch-expected.checksum: Added.
* editing/execCommand/insert-list-and-stitch-expected.png: Added.
* editing/execCommand/insert-list-and-stitch-expected.txt: Added.
* editing/execCommand/insert-list-and-stitch.html: Added.
* editing/execCommand/insert-list-with-id-expected.checksum: Added.
* editing/execCommand/insert-list-with-id-expected.png: Added.
* editing/execCommand/insert-list-with-id-expected.txt: Added.
* editing/execCommand/insert-list-with-id.html: Added.
* editing/execCommand/remove-list-from-range-selection-expected.checksum: Added.
* editing/execCommand/remove-list-from-range-selection-expected.png: Added.
* editing/execCommand/remove-list-from-range-selection-expected.txt: Added.
* editing/execCommand/remove-list-from-range-selection.html: Added.
* editing/execCommand/remove-list-items-expected.checksum: Added.
* editing/execCommand/remove-list-items-expected.png: Added.
* editing/execCommand/remove-list-items-expected.txt: Added.
* editing/execCommand/remove-list-items.html: Added.
* editing/execCommand/switch-list-type-expected.checksum: Added.
* editing/execCommand/switch-list-type-expected.png: Added.
* editing/execCommand/switch-list-type-expected.txt: Added.
* editing/execCommand/switch-list-type.html: Added.
Fixes:
* editing/pasteboard/drag-drop-modifies-page-expected.txt:
* editing/pasteboard/paste-list-001-expected.txt:
* editing/selection/drag-to-contenteditable-iframe-expected.checksum:
* editing/selection/drag-to-contenteditable-iframe-expected.png:
* editing/selection/drag-to-contenteditable-iframe-expected.txt:
* editing/style/block-style-005-expected.txt:
* fast/text/textIteratorNilRenderer-expected.checksum:
* fast/text/textIteratorNilRenderer-expected.png:
* fast/text/textIteratorNilRenderer-expected.txt:
* editing/deleting/delete-line-016-expected.checksum:
* editing/deleting/delete-line-016-expected.png:
* editing/deleting/delete-line-016-expected.txt:
WebCore:
Reviewed by levi
<http://bugzilla.opendarwin.org/show_bug.cgi?id=4468>
Implement execCommand(Insert{Un}OrderedList)
* WebCore.xcodeproj/project.pbxproj: Added InsertListCommand.{h,cpp} to the project.
* dom/Position.cpp:
(WebCore::hasRenderedNonAnonymousDescendantsWithHeight):
Added. A block with height is only a candidate if this is false. This should fix the problems
getting carets into empty blocks.
(WebCore::Position::inRenderedContent):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::hasARenderedDescendant):
(WebCore::CompositeEditCommand::prune): A node can have DOM descendants that are rendered, yet
have no rendered descendants. Fixed the pruning rule to avoid removing a node like this.
(WebCore::CompositeEditCommand::mergeIdenticalElements): Put the two elements next to
each other if they aren't already, as a convenience.
(WebCore::CompositeEditCommand::moveParagraph): Added code to preserve the current selection.
(WebCore::CompositeEditCommand::moveParagraphs): Ditto.
* editing/CompositeEditCommand.h:
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::initializeStartEnd): Expansion for special elements should
continue to happen until it is no longer possible.
(WebCore::DeleteSelectionCommand::handleGeneralDelete): The code to adjust the start node
wouldn't always avoid removing the start block.
* editing/InsertListCommand.cpp: Added.
(WebCore::InsertListCommand::fixOrphanedListChild): Puts a list item that isn't inside a list
into a list.
(WebCore::InsertListCommand::InsertListCommand):
(WebCore::InsertListCommand::modifyRange):
(WebCore::InsertListCommand::doApply):
* editing/InsertListCommand.h: Added.
(WebCore::InsertListCommand::):
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
* editing/JSEditor.cpp:
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance): Don't handle a node if the end of the range used to create the
iterator ends at the start of that node.
used to create the iterator.
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::next):
(WebCore::VisiblePosition::previous):
* editing/VisiblePosition.h:
Added a parameter to next/previous to prevent them from going outside the current editable region.
* editing/htmlediting.cpp:
(WebCore::highestAncestor):
(WebCore::enclosingList):
(WebCore::enclosingListChild):
(WebCore::outermostEnclosingList):
(WebCore::createListItemElement):
* editing/htmlediting.h:
* page/Frame.cpp:
(WebCore::Frame::selectionListState): Added.
* page/Frame.h:
WebKit:
Reviewed by levi
<http://bugzilla.opendarwin.org/show_bug.cgi?id=4468>
Implement execCommand(Insert{Un}OrderedList)
* WebView/WebFrame.m:
(-[WebFrame _findFrameWithSelection]): Removed an assertion
that we only have one frame with a selection.
* WebView/WebView.m:
(-[WebView selectedFrame]): Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc