Commit e6f80c1e authored by justing's avatar justing

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: http://svn.webkit.org/repository/webkit/trunk@14777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent df5ae315
2006-06-08 Justin Garcia <justin.garcia@apple.com>
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:
2006-06-08 David Harrison <harrison@apple.com>
Reviewed by Geoff and John.
cd4b9f5df064d6eb06da38b899187641
\ No newline at end of file
340d92c18109e711126f3aa694b08259
\ No newline at end of file
......@@ -2,7 +2,7 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
......@@ -15,10 +15,11 @@ layer at (0,0) size 800x600
text run at (0,0) width 767: "This tests deletion of an empty line starting inside a <div> element, but ending outside that element (just before a <br>). In"
text run at (0,18) width 766: "this case, the <div> has no content inside it, but a min-height style prevents it from collapsing. If the deletion is successful,"
text run at (0,36) width 725: "the result should have two lines, and the insertion point should be on the second line, at the end of the editable area."
RenderBlock {DIV} at (0,70) size 784x36
RenderBlock {DIV} at (0,70) size 784x68
RenderBlock {DIV} at (0,0) size 784x18
RenderText {#text} at (0,0) size 7x18
text run at (0,0) width 7: "a"
RenderBlock (anonymous) at (0,18) size 784x18
RenderBlock {DIV} at (0,18) size 784x50
RenderBR {BR} at (0,0) size 0x18
caret: position 0 of child 2 {BR} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
RenderBlock (anonymous) at (0,68) size 784x0
caret: position 0 of child 0 {BR} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
df73fe3bb7ebfa11d32d699f1d302fba
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 9 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of #text > SPAN > LI > OL > DIV > BODY > HTML > #document to 2 of #text > SPAN > LI > OL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 632x18
text run at (0,0) width 632: "This tests Insert{Un}OrderedList on a range selection that contains a mix of list and non-list content."
RenderBlock {DIV} at (0,34) size 784x108
RenderBlock (anonymous) at (0,0) size 784x0
RenderBlock {OL} at (0,0) size 784x108
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "asd"
RenderInline {SPAN} at (0,0) size 21x18
RenderText {#text} at (21,0) size 21x18
text run at (21,0) width 21: "foo"
RenderListItem {LI} at (40,18) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 20x18
text run at (0,0) width 20: "bar"
RenderListItem {LI} at (40,36) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 22x18
text run at (0,0) width 22: "baz"
RenderListItem {LI} at (40,54) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "foo"
RenderListItem {LI} at (40,72) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 20x18
text run at (0,0) width 20: "bar"
RenderListItem {LI} at (40,90) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderInline {SPAN} at (0,0) size 22x18
RenderText {#text} at (0,0) size 22x18
text run at (0,0) width 22: "baz"
RenderBlock (anonymous) at (0,124) size 784x0
selection start: position 2 of child 0 {#text} of child 1 {SPAN} of child 0 {LI} of child 0 {OL} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 2 of child 0 {#text} of child 0 {SPAN} of child 5 {LI} of child 0 {OL} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests Insert{Un}OrderedList on a range selection that contains a mix of list and non-list content.</p>
<div id="test" contenteditable="true">asd<span id="start">foo</span><br><ul><li>bar</li></ul>baz<br>foo<ol><li>bar</li></ol><span id="end">baz</span></div>
<script>
var s = window.getSelection();
var start = document.getElementById("start").firstChild;
var end = document.getElementById("end").firstChild;
s.setBaseAndExtent(start, 2, end, 2);
document.execCommand("InsertOrderedList", false, "");
</script>
69ef56ffa5107d11ffd36615abf63a48
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 7 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > DIV > DIV > BODY > HTML > #document to 0 of LI > OL > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > DIV > DIV > BODY > HTML > #document to 0 of LI > OL > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > DIV > DIV > BODY > HTML > #document to 0 of LI > OL > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 613x18
text run at (0,0) width 613: "The three items below should be stitched together into one ordered list when you click the button."
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,34) size 784x54
RenderBlock {DIV} at (0,0) size 784x54
RenderBlock {OL} at (0,0) size 784x54
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "foo"
RenderListItem {LI} at (40,18) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 20x18
text run at (0,0) width 20: "bar"
RenderListItem {LI} at (40,36) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 22x18
text run at (0,0) width 22: "baz"
RenderBlock (anonymous) at (0,70) size 784x0
caret: position 0 of child 0 {#text} of child 2 {LI} of child 0 {OL} of child 1 {DIV} of child 1 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>The three items below should be stitched together into one ordered list when you click the button.</div>
<div contenteditable="true">
<div id="item1">foo</div>
<div id="item2">bar</div>
<div id="item3">baz</div>
</div>
<script>
var s = window.getSelection();
s.setPosition(document.getElementById("item1"), 0);
document.execCommand("InsertOrderedList", false, "");
s.setPosition(document.getElementById("item2"), 0);
document.execCommand("InsertOrderedList", false, "");
s.setPosition(document.getElementById("item3"), 0);
document.execCommand("InsertOrderedList", false, "");
</script>
\ No newline at end of file
574819845e52367902237bf0dea99dd9
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > DIV > BODY > HTML > #document to 0 of LI > OL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 770x36
text run at (0,0) width 770: "This test makes sure Insert{Un}OrderedList properly adds an id to the inserted list when requested. The tests inserts a new"
text run at (0,18) width 497: "list using the command, then removes it programmatically from JS using the id."
RenderBlock (anonymous) at (0,52) size 784x18
RenderBR {BR} at (0,0) size 0x18
RenderBlock {DIV} at (0,70) size 784x18
RenderBlock (anonymous) at (0,88) size 784x18
RenderBR {BR} at (0,0) size 0x18
<p>This test makes sure Insert{Un}OrderedList properly adds an id to the inserted list when requested. The tests inserts a new list using the command, then removes it programmatically from JS using the id.</p>
<br>
<div id="test" contenteditable="true">Foo</div>
<br>
<script>
var s = window.getSelection();
var div = document.getElementById("test");
var id = "foo";
s.setPosition(div, 0);
document.execCommand("InsertOrderedList", false, id);
div.blur();
var list = document.getElementById(id);
list.parentNode.removeChild(list);
</script>
\ No newline at end of file
6ac0c2f3a3aef772a55f5d969074a894
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 528x18
text run at (0,0) width 528: "This tests Insert{Un}OrderedList on a range selection that is entirely within one list."
RenderBlock {DIV} at (0,34) size 784x106
RenderBlock (anonymous) at (0,0) size 784x72
RenderInline {SPAN} at (0,0) size 75x18
RenderText {#text} at (0,0) size 75x18
text run at (0,0) width 75: "None of the"
RenderBR {BR} at (75,14) size 0x0
RenderText {#text} at (0,18) size 100x18
text run at (0,18) width 100: "selected content"
RenderBR {BR} at (100,32) size 0x0
RenderText {#text} at (0,36) size 61x18
text run at (0,36) width 61: "should be"
RenderBR {BR} at (61,50) size 0x0
RenderInline {SPAN} at (0,0) size 49x18
RenderText {#text} at (0,54) size 49x18
text run at (0,54) width 49: "in a list."
RenderBR {BR} at (49,68) size 0x0
RenderBlock {OL} at (0,88) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 316x18
text run at (0,0) width 316: "This should be in a list and should not be selected."
selection start: position 2 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
selection end: position 2 of child 0 {#text} of child 6 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This tests Insert{Un}OrderedList on a range selection that is entirely within one list.</p>
<div id="test" contenteditable="true"><ol><li><span id="start">None of the</span></li><li>selected content</li><li>should be</li><li><span id="end">in a list.</span></li></ol><ol><li>This should be in a list and should not be selected.</li></ol></div>
<script>
var s = window.getSelection();
var start = document.getElementById("start").firstChild;
var end = document.getElementById("end").firstChild;
s.setBaseAndExtent(start, 2, end, 2);
document.execCommand("InsertOrderedList", false, "foo");
</script>
\ No newline at end of file
784acec49fd302c45e00be85429d0a33
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 7 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of SPAN > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of SPAN > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of SPAN > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of SPAN > DIV > BODY > HTML > #document to 0 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 15 of DIV > BODY > HTML > #document to 15 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x36
RenderText {#text} at (0,0) size 738x36
text run at (0,0) width 738: "This test checks to see that Insert{Un}OrderedList can remove items from a list, can remove empty list when they are"
text run at (0,18) width 368: "emptied, and can remove content from orphaned list items."
RenderBlock {DIV} at (0,52) size 784x318
RenderBlock {OL} at (0,0) size 784x20 [border: (1px solid #FF0000)]
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "foo"
RenderBlock (anonymous) at (41,19) size 742x0
RenderBlock (anonymous) at (0,36) size 784x18
RenderInline {SPAN} at (0,0) size 154x18
RenderText {#text} at (0,0) size 154x18
text run at (0,0) width 154: "This should not be a list."
RenderText {#text} at (154,0) size 4x18
text run at (154,0) width 4: " "
RenderBR {BR} at (158,14) size 0x0
RenderBlock {OL} at (0,70) size 784x56 [border: (1px solid #FF0000)]
RenderBlock (anonymous) at (41,1) size 742x36
RenderBR {BR} at (0,0) size 0x18
RenderText {#text} at (0,18) size 20x18
text run at (0,18) width 20: "bar"
RenderListItem {LI} at (41,37) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 22x18
text run at (0,0) width 22: "baz"
RenderBlock (anonymous) at (41,55) size 742x0
RenderBlock (anonymous) at (0,142) size 784x18
RenderInline {SPAN} at (0,0) size 170x18
RenderText {#text} at (0,0) size 170x18
text run at (0,0) width 170: "This should not be in a list."
RenderBR {BR} at (170,14) size 0x0
RenderBlock {OL} at (0,176) size 784x20 [border: (1px solid #FF0000)]
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 21x18
text run at (0,0) width 21: "foo"
RenderBlock (anonymous) at (0,212) size 784x18
RenderInline {SPAN} at (0,0) size 170x18
RenderText {#text} at (0,0) size 170x18
text run at (0,0) width 170: "This should not be in a list."
RenderBR {BR} at (170,14) size 0x0
RenderBlock {OL} at (0,246) size 784x20 [border: (1px solid #FF0000)]
RenderBlock (anonymous) at (41,1) size 742x0
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 20x18
text run at (0,0) width 20: "bar"
RenderBlock (anonymous) at (0,282) size 784x36
RenderInline {SPAN} at (0,0) size 170x18
RenderText {#text} at (0,0) size 170x18
text run at (0,0) width 170: "This should not be in a list."
RenderBR {BR} at (170,14) size 0x0
RenderInline {SPAN} at (0,0) size 170x18
RenderText {#text} at (0,18) size 170x18
text run at (0,18) width 170: "This should not be in a list."
caret: position 0 of child 0 {#text} of child 15 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This test checks to see that Insert{Un}OrderedList can remove items from a list, can remove empty list when they are emptied, and can remove content from orphaned list items.</p>
<div contenteditable="true">
<ol style="border: 1px solid red;">
<li>foo</li>
<span id="item1">This should not be a list.</span>
<br><br>
bar
<li>baz</li>
<span id="item2">This should not be in a list.</span>
<li>foo</li>
<li><span id="item3">This should not be in a list.</span></li>
<li>bar</li>
</ol>
<li><span id="item4">This should not be in a list.</span></li>
<ul><li><span id="item5">This should not be in a list.</span></li></ul>
</div>
<script>
var s = window.getSelection();
s.setPosition(document.getElementById("item1"), 0);
document.execCommand("InsertOrderedList", false, "");
s.setPosition(document.getElementById("item2"), 0);
document.execCommand("InsertOrderedList", false, "");
s.setPosition(document.getElementById("item3"), 0);
document.execCommand("InsertOrderedList", false, "");
s.setPosition(document.getElementById("item4"), 0);
document.execCommand("InsertUnorderedList", false, "");
s.setPosition(document.getElementById("item5"), 0);
document.execCommand("InsertUnorderedList", false, "");
</script>
\ No newline at end of file
1a759665d514ac0a25ee958bf4e2b581
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 6 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > SPAN > DIV > BODY > HTML > #document to 0 of LI > UL > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > SPAN > DIV > BODY > HTML > #document to 0 of LI > UL > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > SPAN > DIV > BODY > HTML > #document to 0 of LI > UL > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > OL > SPAN > DIV > BODY > HTML > #document to 0 of LI > OL > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 495x18
text run at (0,0) width 495: "This test checks to see if InsertOrderedList can switch the list type of list items."
RenderBlock {DIV} at (0,34) size 784x334
RenderBlock {OL} at (0,0) size 784x20 [border: (1px solid #FF0000)]
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (41,19) size 742x0
RenderBlock (anonymous) at (0,36) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock (anonymous) at (0,36) size 784x18
RenderBlock {UL} at (0,0) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-17,0) size 7x18
RenderInline {SPAN} at (0,0) size 222x18
RenderText {#text} at (0,0) size 222x18
text run at (0,0) width 222: "This should be in an unordered list."
RenderText {#text} at (222,0) size 4x18
text run at (222,0) width 4: " "
RenderBlock (anonymous) at (0,70) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock {OL} at (0,70) size 784x56 [border: (1px solid #FF0000)]
RenderBlock (anonymous) at (41,1) size 742x36
RenderBR {BR} at (0,0) size 0x18
RenderText {#text} at (0,18) size 206x18
text run at (0,18) width 206: "This should be in an ordered list."
RenderListItem {LI} at (41,37) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (41,55) size 742x0
RenderBlock (anonymous) at (0,142) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock (anonymous) at (0,142) size 784x18
RenderBlock {UL} at (0,0) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-17,0) size 7x18
RenderInline {SPAN} at (0,0) size 222x18
RenderText {#text} at (0,0) size 222x18
text run at (0,0) width 222: "This should be in an unordered list."
RenderBlock (anonymous) at (0,176) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock {OL} at (0,176) size 784x20 [border: (1px solid #FF0000)]
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (0,212) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock (anonymous) at (0,212) size 784x18
RenderBlock {UL} at (0,0) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-17,0) size 7x18
RenderInline {SPAN} at (0,0) size 222x18
RenderText {#text} at (0,0) size 222x18
text run at (0,0) width 222: "This should be in an unordered list."
RenderBlock (anonymous) at (0,246) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock {OL} at (0,246) size 784x20 [border: (1px solid #FF0000)]
RenderBlock (anonymous) at (41,1) size 742x0
RenderListItem {LI} at (41,1) size 742x18
RenderListMarker at (-20,0) size 16x18
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (0,282) size 784x18
RenderText {#text} at (0,0) size 170x18
text run at (0,0) width 170: "This should not be in a list."
RenderBR {BR} at (170,14) size 0x0
RenderInline {SPAN} at (0,0) size 0x0
RenderBlock (anonymous) at (0,316) size 784x18
RenderBlock {OL} at (0,0) size 784x18
RenderListItem {LI} at (40,0) size 744x18
RenderListMarker at (-20,0) size 16x18
RenderInline {SPAN} at (0,0) size 206x18
RenderText {#text} at (0,0) size 206x18
text run at (0,0) width 206: "This should be in an ordered list."
RenderBlock (anonymous) at (0,350) size 784x0
RenderInline {SPAN} at (0,0) size 0x0
caret: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {LI} of child 0 {OL} of child 10 {SPAN} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
<p>This test checks to see if InsertOrderedList can switch the list type of list items.</p>
<div contenteditable="true">
<ol style="border: 1px solid red;">
<li>This should be in an ordered list.</li>
<span id="item1">This should be in an unordered list.</span>
<br><br>
This should be in an ordered list.
<li>This should be in an ordered list.</li>
<span id="item2">This should be in an unordered list.</span>
<li>This should be in an ordered list.</li>
<li><span id="item3">This should be in an unordered list.</span></li>
<li>This should be in an ordered list.</li>
</ol>
This should not be in a list.
<li><span id="item4">This should be in an ordered list.</span></li>
<script>
var s = window.getSelection();
s.setPosition(document.getElementById("item1"), 0);
document.execCommand("InsertUnorderedList", false, "Moo");
s.setPosition(document.getElementById("item2"), 0);
document.execCommand("InsertUnorderedList", false, "Goo");
s.setPosition(document.getElementById("item3"), 0);
document.execCommand("InsertUnorderedList", false, "Gai");
s.setPosition(document.getElementById("item4"), 0);
document.execCommand("InsertOrderedList", false, "Noodles");
</script>
\ No newline at end of file
......@@ -15,7 +15,6 @@ layer at (0,0) size 800x600
RenderText {#text} at (0,0) size 757x18
text run at (0,0) width 757: "This test does a drag and drop such that the selection around the dragged word is no longer in the document on the drop."
RenderBlock {DIV} at (0,34) size 784x18
RenderInline {SPAN} at (0,0) size 0x0
RenderText {#text} at (0,0) size 37x18
text run at (0,0) width 37: "world"
RenderText {#text} at (37,0) size 4x18
......@@ -23,5 +22,5 @@ layer at (0,0) size 800x600
RenderInline {SPAN} at (0,0) size 31x18
RenderText {#text} at (41,0) size 31x18
text run at (41,0) width 31: "hello"
selection start: position 0 of child 2 {#text} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 5 of child 0 {#text} of child 3 {SPAN} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
selection start: position 0 of child 1 {#text} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 5 of child 0 {#text} of child 2 {SPAN} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
......@@ -5,6 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 21 of #text > LI > OL > DIV > BODY > HTML > #document to 21 of #text > LI > OL > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 21 of #text > LI > OL > DIV > BODY > HTML > #document to 21 of #text > LI > OL > DIV > BODY > HTML > #document toDOMRange:range from 21 of #text > LI > OL > OL > DIV > BODY > HTML > #document to 21 of #text > LI > OL > OL > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE