LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2006 00:09:37 +0000 (00:09 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jun 2006 00:09:37 +0000 (00:09 +0000)
        Reviewed by levi

        Added to demonstrate fixes:
        * editing/pasteboard/merge-after-delete-expected.checksum: Added.
        * editing/pasteboard/merge-after-delete-expected.png: Added.
        * editing/pasteboard/merge-after-delete-expected.txt: Added.
        * editing/pasteboard/merge-after-delete.html: Added.
        * editing/inserting/line-break-expected.checksum: Added.
        * editing/inserting/line-break-expected.png: Added.
        * editing/inserting/line-break-expected.txt: Added.
        * editing/inserting/line-break.html: Added.
        * editing/inserting/multiple-lines-selected-expected.checksum: Added.
        * editing/inserting/multiple-lines-selected-expected.png: Added.
        * editing/inserting/multiple-lines-selected-expected.txt: Added.
        * editing/inserting/multiple-lines-selected.html: Added.

        Fixed:
        * editing/deleting/collapse-whitespace-3587601-fix-expected.txt:
        * editing/deleting/delete-3775172-fix-expected.txt:
        * editing/deleting/delete-3928305-fix-expected.txt:
        * editing/deleting/delete-3959464-fix-expected.checksum:
        * editing/deleting/delete-3959464-fix-expected.png:
        * editing/deleting/delete-3959464-fix-expected.txt:
        * editing/deleting/delete-4038408-fix-expected.checksum:
        * editing/deleting/delete-4038408-fix-expected.png:
        * editing/deleting/delete-4038408-fix-expected.txt:
        * editing/deleting/delete-4038408-fix.html:
        * editing/deleting/delete-at-paragraph-boundaries-002-expected.txt:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.checksum:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.png:
        * editing/deleting/delete-at-paragraph-boundaries-011-expected.txt:
        * editing/deleting/delete-block-contents-001-expected.txt:
        * editing/deleting/delete-block-contents-002-expected.txt:
        * editing/deleting/delete-block-contents-003-expected.txt:
        * editing/deleting/delete-br-011-expected.checksum:
        * editing/deleting/delete-br-011-expected.png:
        * editing/deleting/delete-br-011-expected.txt:
        * editing/deleting/delete-image-004-expected.txt:
        * editing/deleting/delete-line-010-expected.txt:
        * editing/deleting/delete-line-015-expected.txt:
        * editing/deleting/delete-select-all-001-expected.checksum:
        * editing/deleting/delete-select-all-001-expected.png:
        * editing/deleting/delete-select-all-001-expected.txt:
        * editing/deleting/delete-select-all-002-expected.txt:
        * editing/deleting/delete-select-all-003-expected.checksum:
        * editing/deleting/delete-select-all-003-expected.png:
        * editing/deleting/delete-select-all-003-expected.txt:
        * editing/execCommand/insertImage-expected.checksum:
        * editing/execCommand/insertImage-expected.png:
        * editing/input/attributed-substring-from-range-lines-expected.txt:
        * editing/input/text-input-controller-expected.txt:
        * editing/inserting/insert-3654864-fix-expected.txt:
        * editing/inserting/insert-3659587-fix-expected.txt:
        * editing/inserting/insert-3775316-fix-expected.txt:
        * editing/inserting/insert-after-delete-001-expected.txt:
        * editing/inserting/insert-at-end-01-expected.txt:
        * editing/inserting/insert-at-end-02-expected.txt:
        * editing/inserting/insert-br-001-expected.txt:
        * editing/inserting/insert-br-005-expected.txt:
        * editing/pasteboard/4076267-3-expected.txt:
        * editing/pasteboard/4076267-expected.txt:
        * editing/pasteboard/drag-drop-modifies-page-expected.txt:
        * editing/pasteboard/paste-4035648-fix-expected.txt:
        * editing/pasteboard/paste-4039777-fix-expected.checksum:
        * editing/pasteboard/paste-4039777-fix-expected.png:
        * editing/pasteboard/paste-4039777-fix-expected.txt:
        * editing/pasteboard/paste-match-style-001-expected.txt:
        * editing/pasteboard/paste-match-style-002-expected.txt:
        * editing/pasteboard/smart-paste-006-expected.txt:
        * editing/pasteboard/smart-paste-007-expected.txt:
        * editing/selection/drag-to-contenteditable-iframe-expected.txt:
        * editing/style/block-style-005-expected.txt:
        * editing/style/typing-style-002-expected.txt:
        * editing/unsupported-content/list-delete-001-expected.checksum:
        * editing/unsupported-content/list-delete-001-expected.png:
        * editing/unsupported-content/list-delete-001-expected.txt:
        * editing/unsupported-content/list-delete-002-expected.checksum:
        * editing/unsupported-content/list-delete-002-expected.png:
        * editing/unsupported-content/list-delete-002-expected.txt:
        * editing/unsupported-content/table-delete-001-expected.checksum:
        * editing/unsupported-content/table-delete-001-expected.png:
        * editing/unsupported-content/table-delete-001-expected.txt:
        * editing/unsupported-content/table-delete-003-expected.checksum:
        * editing/unsupported-content/table-delete-003-expected.png:
        * editing/unsupported-content/table-delete-003-expected.txt:
        * fast/text/attributed-substring-from-range.html:

WebCore:

        Reviewed by levi

        * dom/Node.cpp:
        (WebCore::Node::firstDescendant): Added.
        * dom/Node.h:
        * dom/Range.cpp: Added a constructor that takes in Positions.
        (WebCore::Range::Range):
        * dom/Range.h:
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::insertNodeAt):
        Let this function insert children into empty containers.
        Calls canHaveChildrenForEditing.
        (WebCore::CompositeEditCommand::appendNode): Assert that the parent canHaveChildrenForEditing.
        (WebCore::CompositeEditCommand::moveParagraph): Tell ReplaceSelectionCommand to select the
        replacement so that moveParagraph's callers have a valid destination after the move.
        * editing/CompositeEditCommand.h: Moved removeFullySelectedNode to DeleteSelectionCommand,
        made deleteTextFromNode virtual so that DeleteSelectionCommand can update it's endingPosition.
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
        Removed m_startNode, used a local variable.
        (WebCore::DeleteSelectionCommand::initializeStartEnd): Fixed special element expansion.
        (WebCore::DeleteSelectionCommand::initializePositionData): Compute the endingPosition up
        front and keep track of it as nodes and text are removed.
        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed use of m_startNode.
        (WebCore::DeleteSelectionCommand::removeFullySelectedNode): Moved from CompositeEditCommand.
        Update m_endingPosition as we remove nodes.
        (WebCore::DeleteSelectionCommand::deleteTextFromNode):
        Update m_endingPosition as we delete text.
        (WebCore::DeleteSelectionCommand::handleGeneralDelete): Retain the start block.  Cleaned up.
        (WebCore::DeleteSelectionCommand::mergeParagraphs): Recompute m_endingPosition since moveParagraph
        clobbers the old one.
        (WebCore::DeleteSelectionCommand::doApply): Fixed the logic for placeholder insertion after
        deletion. Make the placeholder decision before we do special element expansion.
        * editing/DeleteSelectionCommand.h:
        * editing/InsertLineBreakCommand.cpp:
        (WebCore::InsertLineBreakCommand::doApply): Fixed a bug where an extra br was inserted and cleaned
        up the code.
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply): Deletion of the current selection should do
        a merge (added a testcase).
        * editing/RebalanceWhitespaceCommand.cpp:
        (WebCore::RebalanceWhitespaceCommand::doUnapply): Remove/insert in a way that will trigger a layout.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Ditto.
        Merge even when the incoming fragment has interchange newlines (added a testcase).
        Merge when the selection being pasted into starts at the start of a block because not
        doing so would leave one or more hanging empty blocks.
        (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
        Rebalance whitespace using rebalanceWhitespaceAt because rebalanceWhitespace requires
        a selection, and a selection can't be created until whitespace has been rebalanced.
        * editing/htmlediting.cpp:
        (WebCore::canHaveChildrenForEditing): Added.
        * editing/htmlediting.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14751 268f45cc-cd09-0410-ab3c-d52691b4dbfc

98 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt
LayoutTests/editing/deleting/delete-3775172-fix-expected.txt
LayoutTests/editing/deleting/delete-3928305-fix-expected.txt
LayoutTests/editing/deleting/delete-3959464-fix-expected.checksum
LayoutTests/editing/deleting/delete-3959464-fix-expected.png
LayoutTests/editing/deleting/delete-3959464-fix-expected.txt
LayoutTests/editing/deleting/delete-4038408-fix-expected.checksum
LayoutTests/editing/deleting/delete-4038408-fix-expected.png
LayoutTests/editing/deleting/delete-4038408-fix-expected.txt
LayoutTests/editing/deleting/delete-4038408-fix.html
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-002-expected.txt
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.checksum
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.png
LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.txt
LayoutTests/editing/deleting/delete-block-contents-001-expected.txt
LayoutTests/editing/deleting/delete-block-contents-002-expected.txt
LayoutTests/editing/deleting/delete-block-contents-003-expected.txt
LayoutTests/editing/deleting/delete-br-011-expected.checksum
LayoutTests/editing/deleting/delete-br-011-expected.png
LayoutTests/editing/deleting/delete-br-011-expected.txt
LayoutTests/editing/deleting/delete-image-004-expected.txt
LayoutTests/editing/deleting/delete-line-010-expected.txt
LayoutTests/editing/deleting/delete-line-015-expected.txt
LayoutTests/editing/deleting/delete-select-all-001-expected.checksum
LayoutTests/editing/deleting/delete-select-all-001-expected.png
LayoutTests/editing/deleting/delete-select-all-001-expected.txt
LayoutTests/editing/deleting/delete-select-all-002-expected.txt
LayoutTests/editing/deleting/delete-select-all-003-expected.checksum
LayoutTests/editing/deleting/delete-select-all-003-expected.png
LayoutTests/editing/deleting/delete-select-all-003-expected.txt
LayoutTests/editing/execCommand/insertImage-expected.checksum
LayoutTests/editing/execCommand/insertImage-expected.png
LayoutTests/editing/input/attributed-substring-from-range-lines-expected.txt
LayoutTests/editing/input/text-input-controller-expected.txt
LayoutTests/editing/inserting/insert-3654864-fix-expected.txt
LayoutTests/editing/inserting/insert-3659587-fix-expected.txt
LayoutTests/editing/inserting/insert-3775316-fix-expected.txt
LayoutTests/editing/inserting/insert-after-delete-001-expected.txt
LayoutTests/editing/inserting/insert-at-end-01-expected.txt
LayoutTests/editing/inserting/insert-at-end-02-expected.txt
LayoutTests/editing/inserting/insert-br-001-expected.txt
LayoutTests/editing/inserting/insert-br-005-expected.txt
LayoutTests/editing/inserting/line-break-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/line-break-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/line-break-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/line-break.html [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/multiple-lines-selected.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/4076267-3-expected.txt
LayoutTests/editing/pasteboard/4076267-expected.txt
LayoutTests/editing/pasteboard/drag-drop-modifies-page-expected.txt
LayoutTests/editing/pasteboard/merge-after-delete-expected.checksum [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete-expected.png [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/merge-after-delete.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-4035648-fix-expected.txt
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.checksum
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.png
LayoutTests/editing/pasteboard/paste-4039777-fix-expected.txt
LayoutTests/editing/pasteboard/paste-match-style-001-expected.txt
LayoutTests/editing/pasteboard/paste-match-style-002-expected.txt
LayoutTests/editing/pasteboard/smart-paste-006-expected.txt
LayoutTests/editing/pasteboard/smart-paste-007-expected.txt
LayoutTests/editing/selection/drag-to-contenteditable-iframe-expected.txt
LayoutTests/editing/style/block-style-005-expected.txt
LayoutTests/editing/style/typing-style-002-expected.txt
LayoutTests/editing/unsupported-content/list-delete-001-expected.checksum
LayoutTests/editing/unsupported-content/list-delete-001-expected.png
LayoutTests/editing/unsupported-content/list-delete-001-expected.txt
LayoutTests/editing/unsupported-content/list-delete-002-expected.checksum
LayoutTests/editing/unsupported-content/list-delete-002-expected.png
LayoutTests/editing/unsupported-content/list-delete-002-expected.txt
LayoutTests/editing/unsupported-content/table-delete-001-expected.checksum
LayoutTests/editing/unsupported-content/table-delete-001-expected.png
LayoutTests/editing/unsupported-content/table-delete-001-expected.txt
LayoutTests/editing/unsupported-content/table-delete-003-expected.checksum
LayoutTests/editing/unsupported-content/table-delete-003-expected.png
LayoutTests/editing/unsupported-content/table-delete-003-expected.txt
LayoutTests/fast/text/attributed-substring-from-range.html
WebCore/ChangeLog
WebCore/dom/Node.cpp
WebCore/dom/Node.h
WebCore/dom/Range.cpp
WebCore/dom/Range.h
WebCore/editing/CompositeEditCommand.cpp
WebCore/editing/CompositeEditCommand.h
WebCore/editing/DeleteSelectionCommand.cpp
WebCore/editing/DeleteSelectionCommand.h
WebCore/editing/InsertLineBreakCommand.cpp
WebCore/editing/InsertParagraphSeparatorCommand.cpp
WebCore/editing/InsertTextCommand.cpp
WebCore/editing/RebalanceWhitespaceCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/htmlediting.cpp
WebCore/editing/htmlediting.h

index bf73a1c..1cc48eb 100644 (file)
@@ -1,3 +1,92 @@
+2006-06-06  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by levi
+
+        Added to demonstrate fixes:
+        * editing/pasteboard/merge-after-delete-expected.checksum: Added.
+        * editing/pasteboard/merge-after-delete-expected.png: Added.
+        * editing/pasteboard/merge-after-delete-expected.txt: Added.
+        * editing/pasteboard/merge-after-delete.html: Added.
+        * editing/inserting/line-break-expected.checksum: Added.
+        * editing/inserting/line-break-expected.png: Added.
+        * editing/inserting/line-break-expected.txt: Added.
+        * editing/inserting/line-break.html: Added.
+        * editing/inserting/multiple-lines-selected-expected.checksum: Added.
+        * editing/inserting/multiple-lines-selected-expected.png: Added.
+        * editing/inserting/multiple-lines-selected-expected.txt: Added.
+        * editing/inserting/multiple-lines-selected.html: Added.
+        
+        Fixed:
+        * editing/deleting/collapse-whitespace-3587601-fix-expected.txt:
+        * editing/deleting/delete-3775172-fix-expected.txt:
+        * editing/deleting/delete-3928305-fix-expected.txt:
+        * editing/deleting/delete-3959464-fix-expected.checksum:
+        * editing/deleting/delete-3959464-fix-expected.png:
+        * editing/deleting/delete-3959464-fix-expected.txt:
+        * editing/deleting/delete-4038408-fix-expected.checksum:
+        * editing/deleting/delete-4038408-fix-expected.png:
+        * editing/deleting/delete-4038408-fix-expected.txt:
+        * editing/deleting/delete-4038408-fix.html:
+        * editing/deleting/delete-at-paragraph-boundaries-002-expected.txt:
+        * editing/deleting/delete-at-paragraph-boundaries-011-expected.checksum:
+        * editing/deleting/delete-at-paragraph-boundaries-011-expected.png:
+        * editing/deleting/delete-at-paragraph-boundaries-011-expected.txt:
+        * editing/deleting/delete-block-contents-001-expected.txt:
+        * editing/deleting/delete-block-contents-002-expected.txt:
+        * editing/deleting/delete-block-contents-003-expected.txt:
+        * editing/deleting/delete-br-011-expected.checksum:
+        * editing/deleting/delete-br-011-expected.png:
+        * editing/deleting/delete-br-011-expected.txt:
+        * editing/deleting/delete-image-004-expected.txt:
+        * editing/deleting/delete-line-010-expected.txt:
+        * editing/deleting/delete-line-015-expected.txt:
+        * editing/deleting/delete-select-all-001-expected.checksum:
+        * editing/deleting/delete-select-all-001-expected.png:
+        * editing/deleting/delete-select-all-001-expected.txt:
+        * editing/deleting/delete-select-all-002-expected.txt:
+        * editing/deleting/delete-select-all-003-expected.checksum:
+        * editing/deleting/delete-select-all-003-expected.png:
+        * editing/deleting/delete-select-all-003-expected.txt:
+        * editing/execCommand/insertImage-expected.checksum:
+        * editing/execCommand/insertImage-expected.png:
+        * editing/input/attributed-substring-from-range-lines-expected.txt:
+        * editing/input/text-input-controller-expected.txt:
+        * editing/inserting/insert-3654864-fix-expected.txt:
+        * editing/inserting/insert-3659587-fix-expected.txt:
+        * editing/inserting/insert-3775316-fix-expected.txt:
+        * editing/inserting/insert-after-delete-001-expected.txt:
+        * editing/inserting/insert-at-end-01-expected.txt:
+        * editing/inserting/insert-at-end-02-expected.txt:
+        * editing/inserting/insert-br-001-expected.txt:
+        * editing/inserting/insert-br-005-expected.txt:
+        * editing/pasteboard/4076267-3-expected.txt:
+        * editing/pasteboard/4076267-expected.txt:
+        * editing/pasteboard/drag-drop-modifies-page-expected.txt:
+        * editing/pasteboard/paste-4035648-fix-expected.txt:
+        * editing/pasteboard/paste-4039777-fix-expected.checksum:
+        * editing/pasteboard/paste-4039777-fix-expected.png:
+        * editing/pasteboard/paste-4039777-fix-expected.txt:
+        * editing/pasteboard/paste-match-style-001-expected.txt:
+        * editing/pasteboard/paste-match-style-002-expected.txt:
+        * editing/pasteboard/smart-paste-006-expected.txt:
+        * editing/pasteboard/smart-paste-007-expected.txt:
+        * editing/selection/drag-to-contenteditable-iframe-expected.txt:
+        * editing/style/block-style-005-expected.txt:
+        * editing/style/typing-style-002-expected.txt:
+        * editing/unsupported-content/list-delete-001-expected.checksum:
+        * editing/unsupported-content/list-delete-001-expected.png:
+        * editing/unsupported-content/list-delete-001-expected.txt:
+        * editing/unsupported-content/list-delete-002-expected.checksum:
+        * editing/unsupported-content/list-delete-002-expected.png:
+        * editing/unsupported-content/list-delete-002-expected.txt:
+        * editing/unsupported-content/table-delete-001-expected.checksum:
+        * editing/unsupported-content/table-delete-001-expected.png:
+        * editing/unsupported-content/table-delete-001-expected.txt:
+        * editing/unsupported-content/table-delete-003-expected.checksum:
+        * editing/unsupported-content/table-delete-003-expected.png:
+        * editing/unsupported-content/table-delete-003-expected.txt:
+        * fast/text/attributed-substring-from-range.html:
+
 2006-06-06  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Darin.
index 68a7b39..8d677d0 100644 (file)
@@ -43,4 +43,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 75c82eb..75fbc36 100644 (file)
@@ -12,8 +12,9 @@ layer 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 (anonymous) at (0,0) size 784x0
-      RenderBlock {DIV} at (0,0) size 784x0
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,18) size 784x0
         RenderInline {SPAN} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
-caret: position 0 of child 1 {BODY} of child 0 {HTML} of document
+caret: position 0 of child 0 {BR} of child 1 {BODY} of child 0 {HTML} of document
index 3542e96..8a43f55 100644 (file)
@@ -8,7 +8,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-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: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -24,10 +24,9 @@ layer at (0,0) size 800x600
         RenderBlock {DIV} at (14,14) size 756x28
           RenderText {#text} at (0,0) size 32x28
             text run at (0,0) width 32: "foo"
-        RenderBlock {DIV} at (14,42) size 756x28
+        RenderBlock (anonymous) at (14,42) size 756x28
           RenderBR {BR} at (0,0) size 0x28
-        RenderBlock (anonymous) at (14,70) size 756x0
         RenderBlock {DIV} at (14,70) size 756x28
           RenderText {#text} at (0,0) size 34x28
             text run at (0,0) width 34: "baz"
-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
+caret: position 0 of child 2 {BR} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 3eea2b5..1ac833a 100644 (file)
@@ -1 +1 @@
-df4d86dc99529ce63d7276bfcd5dff81
\ No newline at end of file
+27e534b1172fbeb02661372e141c55f1
\ No newline at end of file
index a6b7da6..d0907dc 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-3959464-fix-expected.png and b/LayoutTests/editing/deleting/delete-3959464-fix-expected.png differ
index 9c458e5..68e50b0 100644 (file)
@@ -35,11 +35,12 @@ layer at (0,0) size 800x600
             text run at (274,42) width 50: "must"
         RenderText {#text} at (324,42) size 318x28
           text run at (324,42) width 318: " be a space at the end of the line."
-      RenderBlock {DIV} at (0,108) size 784x140
+      RenderBlock {DIV} at (0,108) size 784x168
         RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
           RenderText {#text} at (14,14) size 32x28
             text run at (14,14) width 32: "foo"
         RenderBlock {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
           RenderBR {BR} at (14,14) size 0x28
-        RenderBlock {DIV} at (0,112) size 784x28 [border: (2px solid #FF0000)]
-caret: position 0 of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBlock {DIV} at (0,112) size 784x56 [border: (2px solid #FF0000)]
+          RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 58443d3..6554c84 100644 (file)
@@ -1 +1 @@
-eb5e85de51ce38462d53d1cf42d65f46
\ No newline at end of file
+d84ee0bd1226a6e456ae4155796440bc
\ No newline at end of file
index 104ed55..98424e3 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-4038408-fix-expected.png and b/LayoutTests/editing/deleting/delete-4038408-fix-expected.png differ
index d72dd02..a14d087 100644 (file)
@@ -4,255 +4,22 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 12 of #text > DIV > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 12 of #text > DIV > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 13 of #text > DIV > DIV > DIV > BODY > HTML > #document to 13 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 13 of #text > DIV > DIV > DIV > BODY > HTML > #document to 13 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 14 of #text > DIV > DIV > DIV > BODY > HTML > #document to 14 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > DIV > DIV > DIV > BODY > HTML > #document to 14 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 15 of #text > DIV > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > DIV > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > DIV > DIV > BODY > HTML > #document to 16 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 16 of #text > DIV > DIV > DIV > BODY > HTML > #document to 16 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 12 of #text > DIV > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 12 of #text > DIV > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 13 of #text > DIV > DIV > DIV > BODY > HTML > #document to 13 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 13 of #text > DIV > DIV > DIV > BODY > HTML > #document to 13 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 14 of #text > DIV > DIV > DIV > BODY > HTML > #document to 14 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 14 of #text > DIV > DIV > DIV > BODY > HTML > #document to 14 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 15 of #text > DIV > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 15 of #text > DIV > DIV > DIV > BODY > HTML > #document to 15 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 16 of #text > DIV > DIV > DIV > BODY > HTML > #document to 16 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 16 of #text > DIV > DIV > DIV > BODY > HTML > #document to 16 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 17 of #text > DIV > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 18 of #text > DIV > DIV > DIV > BODY > HTML > #document to 18 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 18 of #text > DIV > DIV > DIV > BODY > HTML > #document to 18 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 19 of #text > DIV > DIV > DIV > BODY > HTML > #document to 19 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 19 of #text > DIV > DIV > DIV > BODY > HTML > #document to 19 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 20 of #text > DIV > DIV > DIV > BODY > HTML > #document to 20 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 20 of #text > DIV > DIV > DIV > BODY > HTML > #document to 20 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 21 of #text > DIV > DIV > DIV > BODY > HTML > #document to 21 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 21 of #text > DIV > DIV > DIV > BODY > HTML > #document to 21 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 22 of #text > DIV > DIV > DIV > BODY > HTML > #document to 22 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 22 of #text > DIV > DIV > DIV > BODY > HTML > #document to 22 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 23 of #text > DIV > DIV > DIV > BODY > HTML > #document to 23 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 23 of #text > DIV > DIV > DIV > BODY > HTML > #document to 23 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 24 of #text > DIV > DIV > DIV > BODY > HTML > #document to 24 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 24 of #text > DIV > DIV > DIV > BODY > HTML > #document to 24 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 25 of #text > DIV > DIV > DIV > BODY > HTML > #document to 25 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 25 of #text > DIV > DIV > DIV > BODY > HTML > #document to 25 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 26 of #text > DIV > DIV > DIV > BODY > HTML > #document to 26 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 26 of #text > DIV > DIV > DIV > BODY > HTML > #document to 26 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 27 of #text > DIV > DIV > DIV > BODY > HTML > #document to 27 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 27 of #text > DIV > DIV > DIV > BODY > HTML > #document to 27 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 28 of #text > DIV > DIV > DIV > BODY > HTML > #document to 28 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 28 of #text > DIV > DIV > DIV > BODY > HTML > #document to 28 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 29 of #text > DIV > DIV > DIV > BODY > HTML > #document to 29 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 29 of #text > DIV > DIV > DIV > BODY > HTML > #document to 29 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 30 of #text > DIV > DIV > DIV > BODY > HTML > #document to 30 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 30 of #text > DIV > DIV > DIV > BODY > HTML > #document to 30 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 31 of #text > DIV > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 31 of #text > DIV > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 32 of #text > DIV > DIV > DIV > BODY > HTML > #document to 32 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 32 of #text > DIV > DIV > DIV > BODY > HTML > #document to 32 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 33 of #text > DIV > DIV > DIV > BODY > HTML > #document to 33 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 33 of #text > DIV > DIV > DIV > BODY > HTML > #document to 33 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 34 of #text > DIV > DIV > DIV > BODY > HTML > #document to 34 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 34 of #text > DIV > DIV > DIV > BODY > HTML > #document to 34 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 35 of #text > DIV > DIV > DIV > BODY > HTML > #document to 35 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 35 of #text > DIV > DIV > DIV > BODY > HTML > #document to 35 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 36 of #text > DIV > DIV > DIV > BODY > HTML > #document to 36 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 36 of #text > DIV > DIV > DIV > BODY > HTML > #document to 36 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 37 of #text > DIV > DIV > DIV > BODY > HTML > #document to 37 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 37 of #text > DIV > DIV > DIV > BODY > HTML > #document to 37 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 38 of #text > DIV > DIV > DIV > BODY > HTML > #document to 38 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 38 of #text > DIV > DIV > DIV > BODY > HTML > #document to 38 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 39 of #text > DIV > DIV > DIV > BODY > HTML > #document to 39 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 39 of #text > DIV > DIV > DIV > BODY > HTML > #document to 39 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 40 of #text > DIV > DIV > DIV > BODY > HTML > #document to 40 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 40 of #text > DIV > DIV > DIV > BODY > HTML > #document to 40 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 41 of #text > DIV > DIV > DIV > BODY > HTML > #document to 41 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 41 of #text > DIV > DIV > DIV > BODY > HTML > #document to 41 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 42 of #text > DIV > DIV > DIV > BODY > HTML > #document to 42 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 42 of #text > DIV > DIV > DIV > BODY > HTML > #document to 42 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 43 of #text > DIV > DIV > DIV > BODY > HTML > #document to 43 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 43 of #text > DIV > DIV > DIV > BODY > HTML > #document to 43 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 44 of #text > DIV > DIV > DIV > BODY > HTML > #document to 44 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 44 of #text > DIV > DIV > DIV > BODY > HTML > #document to 44 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 45 of #text > DIV > DIV > DIV > BODY > HTML > #document to 45 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 45 of #text > DIV > DIV > DIV > BODY > HTML > #document to 45 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 46 of #text > DIV > DIV > DIV > BODY > HTML > #document to 46 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 46 of #text > DIV > DIV > DIV > BODY > HTML > #document to 46 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 47 of #text > DIV > DIV > DIV > BODY > HTML > #document to 47 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 47 of #text > DIV > DIV > DIV > BODY > HTML > #document to 47 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 48 of #text > DIV > DIV > DIV > BODY > HTML > #document to 48 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 48 of #text > DIV > DIV > DIV > BODY > HTML > #document to 48 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 49 of #text > DIV > DIV > DIV > BODY > HTML > #document to 49 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 49 of #text > DIV > DIV > DIV > BODY > HTML > #document to 49 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 50 of #text > DIV > DIV > DIV > BODY > HTML > #document to 50 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 50 of #text > DIV > DIV > DIV > BODY > HTML > #document to 50 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 51 of #text > DIV > DIV > DIV > BODY > HTML > #document to 51 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 51 of #text > DIV > DIV > DIV > BODY > HTML > #document to 51 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 52 of #text > DIV > DIV > DIV > BODY > HTML > #document to 52 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 52 of #text > DIV > DIV > DIV > BODY > HTML > #document to 52 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 53 of #text > DIV > DIV > DIV > BODY > HTML > #document to 53 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document to 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 53 of #text > DIV > DIV > DIV > BODY > HTML > #document to 53 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 54 of #text > DIV > DIV > DIV > BODY > HTML > #document to 54 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document to 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 54 of #text > DIV > DIV > DIV > BODY > HTML > #document to 54 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 55 of #text > DIV > DIV > DIV > BODY > HTML > #document to 55 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document to 0 of DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 55 of #text > DIV > DIV > DIV > BODY > HTML > #document to 55 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 56 of #text > DIV > DIV > DIV > BODY > HTML > #document to 56 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 35 of #text > DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document to 35 of #text > DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 56 of #text > DIV > DIV > DIV > BODY > HTML > #document to 56 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 57 of #text > DIV > DIV > DIV > BODY > HTML > #document to 57 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 35 of #text > DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document to 35 of #text > DIV > BLOCKQUOTE > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 57 of #text > DIV > DIV > DIV > BODY > HTML > #document to 57 of #text > DIV > DIV > DIV > BODY > HTML > #document toDOMRange:range from 58 of #text > DIV > DIV > DIV > BODY > HTML > #document to 58 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 31 of #text > DIV > DIV > BODY > HTML > #document to 31 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -285,8 +52,7 @@ layer at (0,0) size 800x600
             RenderBlock {DIV} at (18,34) size 722x18
               RenderText {#text} at (0,0) size 208x18
                 text run at (0,0) width 208: "It should have the reply text style"
-          RenderBlock {DIV} at (0,68) size 756x18
-            RenderText {#text} at (0,0) size 354x18
-              text run at (0,0) width 354: "This text should not have the same style as the reply text"
-            RenderBR {BR} at (354,14) size 0x0
-caret: position 58 of child 0 {#text} of child 2 {DIV} of child 11 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+          RenderBlock (anonymous) at (0,68) size 756x18
+            RenderText {#text} at (0,0) size 195x18
+              text run at (0,0) width 195: "This text should not be quoted."
+caret: position 31 of child 2 {#text} of child 11 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 218c7f3..deb8602 100644 (file)
@@ -21,17 +21,12 @@ function editingTest() {
     moveSelectionForwardByCharacterCommand();
     deleteCommand();
     deleteCommand();
-    var string;
-    string = "This is some text";
-    for(i = 0; i < string.length; i++)
-        typeCharacterCommand(string[i]);
-    for(i = 0; i < string.length; i++)
-        extendSelectionBackwardByCharacterCommand();
     deleteCommand();
     deleteCommand();
-    string = "This text should not have the same style as the reply text";
-    for(i = 0; i < string.length; i++)
-        typeCharacterCommand(string[i]);  
+    
+    insertNewlineInQuotedContentCommand();
+    
+    document.execCommand("InsertText", false, "This text should not be quoted.");
 }
 
 </script>
index ef9d2f6..b94ca76 100644 (file)
@@ -4,7 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of DIV > DIV > BODY > HTML > #document to 3 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -33,9 +33,8 @@ layer at (0,0) size 800x600
           RenderBlock {P} at (2,2) size 780x28
             RenderText {#text} at (0,0) size 17x28
               text run at (0,0) width 17: "A"
-          RenderBlock {DIV} at (2,30) size 780x28
+          RenderBlock (anonymous) at (2,30) size 780x28
             RenderBR {BR} at (0,0) size 0x28
-          RenderBlock (anonymous) at (2,58) size 780x0
           RenderBlock {P} at (2,58) size 780x28
             RenderBR {BR} at (0,0) size 0x28
-caret: position 0 of child 0 {BR} of child 3 {DIV} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 0 of child 3 {BR} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 18d2982..f3e3347 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.png and b/LayoutTests/editing/deleting/delete-at-paragraph-boundaries-011-expected.png differ
index 8cf1a5e..2766565 100644 (file)
@@ -3,7 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of P > DIV > BODY > HTML > #document to 0 of P > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -33,10 +33,11 @@ layer at (0,0) size 800x600
           RenderBR {BR} at (397,78) size 0x0
           RenderText {#text} at (0,84) size 468x28
             text run at (0,84) width 468: "Selection is a caret at the start of the fourth line."
-      RenderBlock {DIV} at (0,264) size 784x112 [border: (2px solid #FF0000)]
+      RenderBlock {DIV} at (0,264) size 784x140 [border: (2px solid #FF0000)]
         RenderBlock {P} at (2,26) size 780x32 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 49x28
             text run at (2,2) width 49: "hello"
-        RenderBlock (anonymous) at (2,82) size 780x28
-          RenderBR {BR} at (0,0) size 0x28
-caret: position 0 of child 1 {BR} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBlock {P} at (2,82) size 780x32 [border: (2px solid #FF0000)]
+          RenderBR {BR} at (2,2) size 0x28
+        RenderBlock (anonymous) at (2,138) size 780x0
+caret: position 0 of child 0 {BR} of child 1 {P} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 769e07c..3efb3b1 100644 (file)
@@ -12,4 +12,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 1e8cdb9..6ba5d3e 100644 (file)
@@ -21,4 +21,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 0015b0e..2083046 100644 (file)
@@ -28,4 +28,5 @@ layer at (0,0) size 800x600
             text run at (89,14) width 34: "baz"
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index dc2debc..751ab0e 100644 (file)
@@ -1 +1 @@
-eadcc48b870f7e96ae0c064ce07f967a
\ No newline at end of file
+640bc1de0b5975e0ac2f5c08b6470ce8
\ No newline at end of file
index 6bbe1c4..9927726 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-br-011-expected.png and b/LayoutTests/editing/deleting/delete-br-011-expected.png differ
index 5ab3d46..5e68008 100644 (file)
@@ -2,17 +2,18 @@ EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #do
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of SPAN > FONT > BODY > HTML > #document to 1 of SPAN > FONT > BODY > HTML > #document toDOMRange:range from 1 of SPAN > FONT > BODY > HTML > #document to 1 of SPAN > FONT > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 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
-      RenderText {#text} at (0,0) size 31x18
-        text run at (0,0) width 31: "hello"
-      RenderInline {FONT} at (0,0) size 0x18
-        RenderInline {SPAN} at (0,0) size 0x18
-          RenderBR {BR} at (31,14) size 0x0
-      RenderBR {BR} at (0,18) size 0x18
-caret: position 0 of child 2 {BR} of child 1 {BODY} of child 0 {HTML} of document
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 31x18
+          text run at (0,0) width 31: "hello"
+      RenderBlock {DIV} at (0,18) size 784x56 [border: (2px solid #FF0000)]
+        RenderBR {BR} at (14,14) size 0x28
+      RenderBlock (anonymous) at (0,74) size 784x0
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 6d1d77d..a20fd23 100644 (file)
@@ -13,4 +13,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 63edfd0..9f9831b 100644 (file)
@@ -12,8 +12,9 @@ layer 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 {DIV} at (0,0) size 600x56
+      RenderBlock {DIV} at (0,0) size 600x28
         RenderBR {BR} at (0,0) size 0x28
-        RenderText {#text} at (0,28) size 241x28
-          text run at (0,28) width 241: "Which taken at the flood"
+      RenderBlock {DIV} at (0,28) size 600x28
+        RenderText {#text} at (0,0) size 241x28
+          text run at (0,0) width 241: "Which taken at the flood"
 caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 58b3dbd..6dc2bfa 100644 (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
@@ -19,6 +19,7 @@ layer at (0,0) size 800x600
         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 784x18
           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,36) 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
index 4a1952f..0b5ca26 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-select-all-001-expected.png and b/LayoutTests/editing/deleting/delete-select-all-001-expected.png differ
index 0f697e3..ea34267 100644 (file)
@@ -11,5 +11,9 @@ layer 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 {DIV} at (0,0) size 784x28 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+      RenderBlock {DIV} at (0,0) size 784x46 [border: (2px solid #FF0000)]
+        RenderBlock (anonymous) at (14,14) size 756x18
+          RenderInline {FONT} at (0,0) size 0x18
+            RenderInline {SPAN} at (0,0) size 0x18
+              RenderBR {BR} at (0,0) size 0x18
+caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index bb77365..6a19825 100644 (file)
@@ -12,4 +12,5 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderBR {BR} at (14,14) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 4a1952f..8923ec9 100644 (file)
Binary files a/LayoutTests/editing/deleting/delete-select-all-003-expected.png and b/LayoutTests/editing/deleting/delete-select-all-003-expected.png differ
index f8bdedc..22c6085 100644 (file)
@@ -11,5 +11,7 @@ layer 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 {DIV} at (0,0) size 784x28 [border: (2px solid #FF0000)]
-caret: position 0 of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderBlock (anonymous) at (14,14) size 756x28
+          RenderBR {BR} at (0,0) size 0x28
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 87e570a..843e2e0 100644 (file)
@@ -1 +1 @@
-f499376d691916de445ac4938a132c3b
\ No newline at end of file
+626aa85257a0662dff6cfee7878aebe4
\ No newline at end of file
index 18c0477..4be2c3e 100644 (file)
Binary files a/LayoutTests/editing/execCommand/insertImage-expected.png and b/LayoutTests/editing/execCommand/insertImage-expected.png differ
index bfeda65..d572d74 100644 (file)
@@ -51,7 +51,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document toDOMRange:range from 3 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -110,12 +110,12 @@ Actual HTML:
 (0, 6) length: 6
 (0, 7): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
 (0, 7) length: 8
-(0, 31): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
-(0, 31) length: 8
-(0, 100): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
-(0, 100) length: 8
-(1, 100): 2{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
-(1, 100) length: 7
+(0, 31): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}line two{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}and { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
+(0, 31) length: 22
+(0, 100): 12{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}line two{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}and { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
+(0, 100) length: 22
+(1, 100): 2{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }456{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}line two{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}and { NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
+(1, 100) length: 21
 (2, 3): 3{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Bold 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }45{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
 (2, 3) length: 3
 (5, 1): 6{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-BoldItalic 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
index be49f3a..d0c9ae3 100644 (file)
@@ -13,13 +13,13 @@ EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > BODY > HTML
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index ce6775c..e43a553 100644 (file)
@@ -3,10 +3,10 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > BODY > HTML > #document to 5 of #text > I > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of BODY > HTML > #document to 2 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of BODY > HTML > #document to 1 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document toDOMRange:range from 2 of #text > BODY > HTML > #document to 2 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -23,5 +23,7 @@ layer at (0,0) size 800x600
       RenderBR {BR} at (14,14) size 0x28
       RenderText {#text} at (14,42) size 36x28
         text run at (14,42) width 36: "xxx"
-      RenderBR {BR} at (50,64) size 0x0
-caret: position 3 of child 2 {#text} of child 1 {BODY} of child 0 {HTML} of document
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+caret: position 3 of child 1 {#text} of child 1 {BODY} of child 0 {HTML} of document
index 579b17a..4f1d13b 100644 (file)
@@ -28,7 +28,7 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > B > SPAN > DIV > BODY > HTML > #document to 10 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of B > SPAN > DIV > BODY > HTML > #document to 2 of B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > B > SPAN > DIV > BODY > HTML > #document to 1 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > B > SPAN > DIV > BODY > HTML > #document to 2 of #text > B > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -50,6 +50,5 @@ layer at (0,0) size 800x600
             RenderBR {BR} at (122,36) size 0x0
             RenderText {#text} at (14,42) size 36x28
               text run at (14,42) width 36: "xxx"
-            RenderBR {BR} at (50,64) size 0x0
         RenderText {#text} at (0,0) size 0x0
 caret: position 3 of child 2 {#text} of child 0 {B} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 09bc735..5a494c7 100644 (file)
@@ -5,7 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -13,13 +13,13 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -28,12 +28,9 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
-        RenderInline {SPAN} at (0,0) size 12x56
-          RenderText {#text} at (14,14) size 12x28
-            text run at (14,14) width 12: "x"
-          RenderBR {BR} at (26,36) size 0x0
-          RenderText {#text} at (14,42) size 12x28
-            text run at (14,42) width 12: "x"
-          RenderBR {BR} at (26,64) size 0x0
-        RenderText {#text} at (0,0) size 0x0
-caret: position 1 of child 2 {#text} of child 0 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+        RenderText {#text} at (14,14) size 12x28
+          text run at (14,14) width 12: "x"
+        RenderBR {BR} at (26,36) size 0x0
+        RenderText {#text} at (14,42) size 12x28
+          text run at (14,42) width 12: "x"
+caret: position 1 of child 2 {#text} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index fd3b3ac..9858678 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > BODY > HTML > #document to 2 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 3e7e5ed..e5c1e86 100644 (file)
@@ -3,7 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -29,5 +29,4 @@ layer at (0,0) size 800x600
         RenderBlock (anonymous) at (2,46) size 780x18
           RenderText {#text} at (0,0) size 8x18
             text run at (0,0) width 8: "x"
-          RenderBR {BR} at (8,14) size 0x0
 caret: position 1 of child 5 {#text} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 3dbe1ba..60d87a9 100644 (file)
@@ -3,7 +3,7 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -29,5 +29,4 @@ layer at (0,0) size 800x600
         RenderBlock (anonymous) at (2,46) size 780x18
           RenderText {#text} at (0,0) size 8x18
             text run at (0,0) width 8: "x"
-          RenderBR {BR} at (8,14) size 0x0
 caret: position 1 of child 5 {#text} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 40e53be..5fe9749 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of SPAN > DIV > BODY > HTML > #document to 2 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 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
@@ -22,6 +22,5 @@ layer at (0,0) size 800x600
           RenderBR {BR} at (48,36) size 0x0
           RenderText {#text} at (14,42) size 12x28
             text run at (14,42) width 12: "x"
-          RenderBR {BR} at (26,64) size 0x0
         RenderText {#text} at (0,0) size 0x0
 caret: position 1 of child 2 {#text} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 75b3c14..731cb15 100644 (file)
@@ -9,7 +9,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 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
@@ -25,6 +25,5 @@ layer at (0,0) size 800x600
           RenderBR {BR} at (14,42) size 0x28
           RenderText {#text} at (14,70) size 12x28
             text run at (14,70) width 12: "x"
-          RenderBR {BR} at (26,92) size 0x0
         RenderText {#text} at (0,0) size 0x0
 caret: position 1 of child 3 {#text} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/inserting/line-break-expected.checksum b/LayoutTests/editing/inserting/line-break-expected.checksum
new file mode 100644 (file)
index 0000000..2af1cef
--- /dev/null
@@ -0,0 +1 @@
+50ed08baa13fc164a56e06835dcd22ca
\ No newline at end of file
diff --git a/LayoutTests/editing/inserting/line-break-expected.png b/LayoutTests/editing/inserting/line-break-expected.png
new file mode 100644 (file)
index 0000000..14abc5b
Binary files /dev/null and b/LayoutTests/editing/inserting/line-break-expected.png differ
diff --git a/LayoutTests/editing/inserting/line-break-expected.txt b/LayoutTests/editing/inserting/line-break-expected.txt
new file mode 100644 (file)
index 0000000..fef5b76
--- /dev/null
@@ -0,0 +1,20 @@
+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:range from 1 of DIV > DIV > BODY > HTML > #document to 1 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of DIV > DIV > BODY > HTML > #document to 1 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+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 753x36
+          text run at (0,0) width 282: "This testcase used to break InsertLineBreak. "
+          text run at (282,0) width 471: "The editable region below should have two empty paragraphs in it, and the"
+          text run at (0,18) width 186: "caret should be in the second."
+      RenderBlock {DIV} at (0,52) size 784x36
+        RenderBlock {DIV} at (0,0) size 784x36
+          RenderBR {BR} at (0,0) size 0x18
+          RenderBR {BR} at (0,18) size 0x18
+caret: position 0 of child 2 {BR} of child 0 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/inserting/line-break.html b/LayoutTests/editing/inserting/line-break.html
new file mode 100644 (file)
index 0000000..5495da7
--- /dev/null
@@ -0,0 +1,13 @@
+<p>This testcase used to break InsertLineBreak.  The editable region below should have two empty paragraphs in it, and the caret should be in the second.</p>
+
+<div id="test" contenteditable="true"><div>
+<br></div></div>
+
+<script>
+var s = window.getSelection();
+var e = document.getElementById("test");
+
+s.setPosition(e, 0);
+document.execCommand("InsertLineBreak");
+
+</script>
\ No newline at end of file
diff --git a/LayoutTests/editing/inserting/multiple-lines-selected-expected.checksum b/LayoutTests/editing/inserting/multiple-lines-selected-expected.checksum
new file mode 100644 (file)
index 0000000..08bbe14
--- /dev/null
@@ -0,0 +1 @@
+16fee619a8875ae81d102605d4296c75
\ No newline at end of file
diff --git a/LayoutTests/editing/inserting/multiple-lines-selected-expected.png b/LayoutTests/editing/inserting/multiple-lines-selected-expected.png
new file mode 100644 (file)
index 0000000..b84be79
Binary files /dev/null and b/LayoutTests/editing/inserting/multiple-lines-selected-expected.png differ
diff --git a/LayoutTests/editing/inserting/multiple-lines-selected-expected.txt b/LayoutTests/editing/inserting/multiple-lines-selected-expected.txt
new file mode 100644 (file)
index 0000000..b7d3fd5
--- /dev/null
@@ -0,0 +1,26 @@
+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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+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
+  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 783x36
+          text run at (0,0) width 556: "This tests inserting a paragraph separator into a selection that spans multiple paragraphs. "
+          text run at (556,0) width 227: "'ar' should be on the line after 'f' and"
+          text run at (0,18) width 232: "the caret should be just before the 'a'."
+      RenderBlock {DIV} at (0,52) size 784x36
+        RenderBlock {DIV} at (0,0) size 784x18
+          RenderText {#text} at (0,0) size 5x18
+            text run at (0,0) width 5: "f"
+        RenderBlock {DIV} at (0,18) size 784x18
+          RenderText {#text} at (0,0) size 12x18
+            text run at (0,0) width 12: "ar"
+caret: position 0 of child 0 {#text} of child 1 {DIV} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/inserting/multiple-lines-selected.html b/LayoutTests/editing/inserting/multiple-lines-selected.html
new file mode 100644 (file)
index 0000000..e678efa
--- /dev/null
@@ -0,0 +1,14 @@
+<p>This tests inserting a paragraph separator into a selection that spans multiple paragraphs.  'ar' should be on the line after 'f' and the caret should be just before the 'a'.</p>
+<div id="test" contenteditable="true"><div>foo</div><div>bar</div></div>
+
+<script>
+var s = window.getSelection();
+var e = document.getElementById("test");
+
+s.setPosition(e, 0);
+s.modify("move", "forward", "character");
+s.modify("extend", "forward", "line");
+
+document.execCommand("InsertParagraph");
+
+</script>
\ No newline at end of file
index 062693b..2054ad3 100644 (file)
@@ -17,7 +17,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -43,7 +43,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x  x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -73,7 +73,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x   x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -107,7 +107,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x    x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -145,7 +145,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x     x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -187,7 +187,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x      x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -233,7 +233,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x       x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -283,7 +283,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x        x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -337,7 +337,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x         x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 11 of #text > DIV > DIV > BODY > HTML > #document to 11 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -395,7 +395,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:x          x replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 12 of #text > DIV > DIV > BODY > HTML > #document to 12 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index e415015..b2d8a5f 100644 (file)
@@ -10,7 +10,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText: this text should have a single leading space before it replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 55 of #text > DIV > DIV > BODY > HTML > #document to 55 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 55 of #text > DIV > DIV > BODY > HTML > #document to 55 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 7f40923..d0fce0c 100644 (file)
@@ -15,6 +15,7 @@ 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
@@ -22,5 +23,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 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
+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
diff --git a/LayoutTests/editing/pasteboard/merge-after-delete-expected.checksum b/LayoutTests/editing/pasteboard/merge-after-delete-expected.checksum
new file mode 100644 (file)
index 0000000..99f033c
--- /dev/null
@@ -0,0 +1 @@
+55cba34ddd312b537920922307677816
\ No newline at end of file
diff --git a/LayoutTests/editing/pasteboard/merge-after-delete-expected.png b/LayoutTests/editing/pasteboard/merge-after-delete-expected.png
new file mode 100644 (file)
index 0000000..e81cb5e
Binary files /dev/null and b/LayoutTests/editing/pasteboard/merge-after-delete-expected.png differ
diff --git a/LayoutTests/editing/pasteboard/merge-after-delete-expected.txt b/LayoutTests/editing/pasteboard/merge-after-delete-expected.txt
new file mode 100644 (file)
index 0000000..e37b214
--- /dev/null
@@ -0,0 +1,24 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+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
+  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 {DIV} at (4,0) size 776x54 [border: (1px solid #0000FF)]
+        RenderBlock {DIV} at (5,5) size 766x20 [border: (1px solid #0000FF)]
+          RenderText {#text} at (1,1) size 5x18
+            text run at (1,1) width 5: "f"
+          RenderText {#text} at (6,1) size 21x18
+            text run at (6,1) width 21: "foo"
+        RenderBlock (anonymous) at (1,29) size 774x0
+        RenderBlock {DIV} at (5,29) size 766x20 [border: (1px solid #0000FF)]
+          RenderBR {BR} at (1,1) size 0x18
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 0 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/pasteboard/merge-after-delete.html b/LayoutTests/editing/pasteboard/merge-after-delete.html
new file mode 100644 (file)
index 0000000..ba5508c
--- /dev/null
@@ -0,0 +1,22 @@
+<style>
+div {
+    border: 1px solid blue;
+    margin: 4px;
+}
+</style>
+
+<div id="test" contenteditable="true"><div>foo</div>bar<br></div>
+
+<script>
+var s = window.getSelection();
+var e = document.getElementById("test");
+
+s.setPosition(e, 0);
+
+s.modify("move", "forward", "character");
+s.modify("extend", "forward", "line");
+s.modify("extend", "forward", "line");
+
+document.execCommand("InsertHTML", false, "<div>foo</div><br class='Apple-interchange-newline'>");
+
+</script>
\ No newline at end of file
index 3deb019..74956bb 100644 (file)
@@ -9,7 +9,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 32bb72d..2debd6b 100644 (file)
@@ -1 +1 @@
-a4b8cdb0d9d69fd1a593f8936836cd48
\ No newline at end of file
+a736b9c13c7b16504ed0aee65e245f92
\ No newline at end of file
index 654e795..0fb1966 100644 (file)
Binary files a/LayoutTests/editing/pasteboard/paste-4039777-fix-expected.png and b/LayoutTests/editing/pasteboard/paste-4039777-fix-expected.png differ
index 9513ccd..44a55f9 100644 (file)
@@ -50,7 +50,7 @@ layer at (0,0) size 800x600
                 RenderBR {BR} at (0,0) size 0x0
                 RenderText {#text} at (0,28) size 16x28
                   text run at (0,28) width 16: "C"
-      RenderBlock {DIV} at (0,364) size 784x120
+      RenderBlock {DIV} at (0,364) size 784x148
         RenderBlock {UL} at (0,0) size 784x28
           RenderBlock (anonymous) at (40,0) size 744x0
             RenderInline {FONT} at (0,0) size 0x0
@@ -87,7 +87,8 @@ layer at (0,0) size 800x600
                 RenderInline {SPAN} at (0,0) size 16x28
                   RenderText {#text} at (0,28) size 16x28
                     text run at (0,28) width 16: "C"
-        RenderBlock {DIV} at (0,116) size 784x4 [border: (2px solid #FF0000)]
-          RenderBlock (anonymous) at (2,2) size 780x0
-          RenderBlock {DIV} at (2,2) size 780x0
+        RenderBlock {DIV} at (0,116) size 784x32 [border: (2px solid #FF0000)]
+          RenderBlock (anonymous) at (2,2) size 780x28
+            RenderBR {BR} at (780,0) size 0x28
+          RenderBlock {DIV} at (2,30) size 780x0
 caret: position 1 of child 0 {#text} of child 0 {SPAN} of child 3 {FONT} of child 2 {LI} of child 2 {UL} of child 2 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 4786cf7..49ef9db 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > BODY
 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
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:b replacingDOMRange:range from 1 of #text > B > DIV > DIV > BODY > HTML > #document to 1 of #text > B > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
index 0cc11f3..66e97a2 100644 (file)
@@ -7,7 +7,7 @@ EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldInsertText:hello replacingDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > B > DIV > DIV > BODY > HTML > #document to 5 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > B > DIV > DIV > BODY > HTML > #document to 5 of #text > B > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
index 71e8029..af39d71 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > BODY
 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
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index f035d4c..3852b90 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > BODY
 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
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
index 8678924..9916017 100644 (file)
@@ -1,8 +1,9 @@
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 2 of BODY > HTML > #document to 2 of BODY > HTML > #document givenAction:WebViewInsertActionDropped
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of BODY > HTML > #document to 2 of BODY > HTML > #document toDOMRange:range from 0 of #text > BODY > HTML > #document to 5 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of IFRAME > BODY > HTML > #document to 1 of IFRAME > BODY > HTML > #document toDOMRange:range from 1 of IFRAME > BODY > HTML > #document to 1 of IFRAME > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 6 of BODY > HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of IFRAME > BODY > HTML > #document to 1 of IFRAME > BODY > HTML > #document toDOMRange:range from 1 of IFRAME > BODY > HTML > #document to 1 of IFRAME > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document givenAction:WebViewInsertActionDropped
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
index 854a1da..f6289db 100644 (file)
@@ -54,6 +54,7 @@ layer at (0,0) size 800x600
               RenderBR {BR} at (0,0) size 0x69
         RenderBlock {DIV} at (0,138) size 784x69
           RenderInline {FONT} at (0,0) size 0x55
-            RenderInline {SPAN} at (0,0) size 0x69
-              RenderBR {BR} at (0,0) size 0x69
-caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+            RenderInline {FONT} at (0,0) size 0x55
+              RenderInline {SPAN} at (0,0) size 0x69
+                RenderBR {BR} at (0,0) size 0x69
+caret: position 0 of child 0 {BR} of child 0 {SPAN} of child 0 {FONT} of child 0 {FONT} of child 3 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index ddd7d7f..430e0fb 100644 (file)
@@ -22,6 +22,9 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > SPAN > DIV > BODY > HTML > #document to 1 of #text > I > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > I > SPAN > DIV > BODY > HTML > #document to 1 of #text > I > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > I > SPAN > DIV > BODY > HTML > #document to 1 of #text > I > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > I > SPAN > DIV > BODY > HTML > #document to 1 of #text > I > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > I > SPAN > DIV > BODY > HTML > #document to 2 of #text > I > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
@@ -31,9 +34,6 @@ EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > I > SPAN > DIV > BODY > HTML > #document to 3 of #text > I > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > I > SPAN > DIV > BODY > HTML > #document to 4 of #text > I > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > I > SPAN > DIV > BODY > HTML > #document to 4 of #text > I > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > I > SPAN > DIV > BODY > HTML > #document to 5 of #text > I > 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
@@ -43,10 +43,13 @@ layer at (0,0) size 800x600
         RenderInline {SPAN} at (0,0) size 166x28
           RenderText {#text} at (14,14) size 70x28
             text run at (14,14) width 70: "here is "
-          RenderInline {I} at (0,0) size 53x28
-            RenderText {#text} at (84,14) size 53x28
-              text run at (84,14) width 53: "sxxxx"
+          RenderInline {I} at (0,0) size 9x28
+            RenderText {#text} at (84,14) size 9x28
+              text run at (84,14) width 9: "s"
+          RenderInline {I} at (0,0) size 44x28
+            RenderText {#text} at (93,14) size 44x28
+              text run at (93,14) width 44: "xxxx"
           RenderText {#text} at (137,14) size 43x28
             text run at (137,14) width 43: " text"
         RenderText {#text} at (0,0) size 0x0
-caret: position 5 of child 0 {#text} of child 1 {I} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+caret: position 4 of child 0 {#text} of child 2 {I} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 1748d77..ade6782 100644 (file)
Binary files a/LayoutTests/editing/unsupported-content/list-delete-001-expected.png and b/LayoutTests/editing/unsupported-content/list-delete-001-expected.png differ
index 1bff77d..2a8bc39 100644 (file)
@@ -11,7 +11,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of LI > UL > DIV > DIV > BODY > HTML > #document to 0 of LI > UL > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -51,10 +51,15 @@ layer at (0,0) size 800x600
       RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 107x28
           text run at (2,2) width 107: "beforeafter"
-      RenderBlock {DIV} at (0,302) size 784x32
-        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
-          RenderText {#text} at (2,2) size 62x28
-            text run at (2,2) width 62: "before"
-          RenderText {#text} at (64,2) size 45x28
-            text run at (64,2) width 45: "after"
-caret: position 7 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+      RenderBlock {DIV} at (0,302) size 784x108
+        RenderBlock {DIV} at (0,0) size 784x108 [border: (2px solid #FF0000)]
+          RenderBlock (anonymous) at (2,2) size 780x28
+            RenderText {#text} at (0,0) size 62x28
+              text run at (0,0) width 62: "before"
+          RenderBlock {UL} at (2,54) size 780x28
+            RenderListItem {LI} at (40,0) size 740x28
+              RenderListMarker at (-22,0) size 9x28
+              RenderText {#text} at (0,0) size 45x28
+                text run at (0,0) width 45: "after"
+          RenderBlock (anonymous) at (2,106) size 780x0
+caret: position 0 of child 0 {#text} of child 1 {LI} of child 1 {UL} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 83b354f..a8695ef 100644 (file)
Binary files a/LayoutTests/editing/unsupported-content/list-delete-002-expected.png and b/LayoutTests/editing/unsupported-content/list-delete-002-expected.png differ
index 07cf182..f6dfadd 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 2 of DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -55,10 +55,11 @@ layer at (0,0) size 800x600
       RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 113x28
           text run at (2,2) width 113: "before after"
-      RenderBlock {DIV} at (0,302) size 784x32
-        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
+      RenderBlock {DIV} at (0,302) size 784x60
+        RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 62x28
             text run at (2,2) width 62: "before"
-          RenderText {#text} at (64,2) size 45x28
-            text run at (64,2) width 45: "after"
-caret: position 7 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+          RenderBR {BR} at (64,24) size 0x0
+          RenderText {#text} at (2,30) size 45x28
+            text run at (2,30) width 45: "after"
+caret: position 0 of child 2 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index b561e3d..bd10241 100644 (file)
Binary files a/LayoutTests/editing/unsupported-content/table-delete-001-expected.png and b/LayoutTests/editing/unsupported-content/table-delete-001-expected.png differ
index 692833b..cf355ee 100644 (file)
@@ -20,7 +20,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of SPAN > FONT > DIV > DIV > BODY > HTML > #document to 1 of SPAN > FONT > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -60,10 +60,13 @@ layer at (0,0) size 800x600
       RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 107x28
           text run at (2,2) width 107: "beforeafter"
-      RenderBlock {DIV} at (0,302) size 784x32
-        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
+      RenderBlock {DIV} at (0,302) size 784x60
+        RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
           RenderText {#text} at (2,2) size 62x28
             text run at (2,2) width 62: "before"
-          RenderText {#text} at (64,2) size 45x28
-            text run at (64,2) width 45: "after"
-caret: position 7 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+          RenderInline {FONT} at (0,0) size 0x22
+            RenderInline {SPAN} at (0,0) size 0x18
+              RenderBR {BR} at (64,24) size 0x0
+          RenderText {#text} at (2,30) size 45x28
+            text run at (2,30) width 45: "after"
+caret: position 0 of child 2 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 8004726..5267423 100644 (file)
Binary files a/LayoutTests/editing/unsupported-content/table-delete-003-expected.png and b/LayoutTests/editing/unsupported-content/table-delete-003-expected.png differ
index 2234d84..20c776a 100644 (file)
@@ -52,8 +52,9 @@ layer at (0,0) size 800x600
       RenderBlock {DIV} at (0,260) size 784x32 [border: (2px solid #008000)]
         RenderText {#text} at (2,2) size 45x28
           text run at (2,2) width 45: "after"
-      RenderBlock {DIV} at (0,302) size 784x32
-        RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
-          RenderText {#text} at (2,2) size 45x28
-            text run at (2,2) width 45: "after"
-caret: position 0 of child 0 {#text} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+      RenderBlock {DIV} at (0,302) size 784x60
+        RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
+          RenderBR {BR} at (2,2) size 0x28
+          RenderText {#text} at (2,30) size 45x28
+            text run at (2,30) width 45: "after"
+caret: position 0 of child 0 {BR} of child 1 {DIV} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 41c3fb1..0efd324 100644 (file)
@@ -66,7 +66,7 @@ body { margin: 10; padding: 0 }
         document.body.appendChild(console);
         
     } else {
-        document.write("(cannot run interactively)");
+        document.write("This testcase is buggy: 9337.  (cannot run interactively)");
     }
 </script>
 </body>
index b22c97a..fc44cd7 100644 (file)
@@ -1,3 +1,59 @@
+2006-06-06  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by levi
+
+        * dom/Node.cpp:
+        (WebCore::Node::firstDescendant): Added.
+        * dom/Node.h:
+        * dom/Range.cpp: Added a constructor that takes in Positions.
+        (WebCore::Range::Range):
+        * dom/Range.h:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::insertNodeAt): 
+        Let this function insert children into empty containers.  
+        Calls canHaveChildrenForEditing.
+        (WebCore::CompositeEditCommand::appendNode): Assert that the parent canHaveChildrenForEditing.
+        (WebCore::CompositeEditCommand::moveParagraph): Tell ReplaceSelectionCommand to select the 
+        replacement so that moveParagraph's callers have a valid destination after the move.
+        * editing/CompositeEditCommand.h: Moved removeFullySelectedNode to DeleteSelectionCommand,
+        made deleteTextFromNode virtual so that DeleteSelectionCommand can update it's endingPosition.
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): 
+        Removed m_startNode, used a local variable.
+        (WebCore::DeleteSelectionCommand::initializeStartEnd): Fixed special element expansion.
+        (WebCore::DeleteSelectionCommand::initializePositionData): Compute the endingPosition up
+        front and keep track of it as nodes and text are removed.
+        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete): Removed use of m_startNode.
+        (WebCore::DeleteSelectionCommand::removeFullySelectedNode): Moved from CompositeEditCommand.
+        Update m_endingPosition as we remove nodes.
+        (WebCore::DeleteSelectionCommand::deleteTextFromNode): 
+        Update m_endingPosition as we delete text.
+        (WebCore::DeleteSelectionCommand::handleGeneralDelete): Retain the start block.  Cleaned up.
+        (WebCore::DeleteSelectionCommand::mergeParagraphs): Recompute m_endingPosition since moveParagraph
+        clobbers the old one.
+        (WebCore::DeleteSelectionCommand::doApply): Fixed the logic for placeholder insertion after 
+        deletion. Make the placeholder decision before we do special element expansion.
+        * editing/DeleteSelectionCommand.h:
+        * editing/InsertLineBreakCommand.cpp:
+        (WebCore::InsertLineBreakCommand::doApply): Fixed a bug where an extra br was inserted and cleaned 
+        up the code.
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply): Deletion of the current selection should do
+        a merge (added a testcase).
+        * editing/RebalanceWhitespaceCommand.cpp:
+        (WebCore::RebalanceWhitespaceCommand::doUnapply): Remove/insert in a way that will trigger a layout.
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply): Ditto.
+        Merge even when the incoming fragment has interchange newlines (added a testcase).
+        Merge when the selection being pasted into starts at the start of a block because not
+        doing so would leave one or more hanging empty blocks.
+        (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
+        Rebalance whitespace using rebalanceWhitespaceAt because rebalanceWhitespace requires
+        a selection, and a selection can't be created until whitespace has been rebalanced.
+        * editing/htmlediting.cpp:
+        (WebCore::canHaveChildrenForEditing): Added.
+        * editing/htmlediting.h:
+
 2006-06-06  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Maciej.
index b5c0062..d871834 100644 (file)
@@ -191,6 +191,14 @@ Node *Node::lastDescendant() const
     return n;
 }
 
+Node* Node::firstDescendant() const
+{
+    Node *n = const_cast<Node *>(this);
+    while (n && n->firstChild())
+        n = n->firstChild();
+    return n;
+}
+
 bool Node::insertBefore(PassRefPtr<Node>, Node*, ExceptionCode& ec)
 {
     ec = HIERARCHY_REQUEST_ERR;
index cbaad36..a3e1b73 100644 (file)
@@ -126,7 +126,8 @@ public:
     void setTextContent(const String&, ExceptionCode&);
     
     Node* lastDescendant() const;
-
+    Node* firstDescendant() const;
+    
     // Other methods (not part of DOM)
 
     virtual bool isElementNode() const { return false; }
index 0c2ee6a..5de451f 100644 (file)
@@ -63,6 +63,16 @@ Range::Range(Document* ownerDocument,
 {
 }
 
+Range::Range(Document* ownerDocument, const Position& start, const Position& end)
+    : m_ownerDocument(ownerDocument)
+    , m_startContainer(start.node())
+    , m_startOffset(start.offset())
+    , m_endContainer(end.node())
+    , m_endOffset(end.offset())
+    , m_detached(false)
+{
+}
+
 Range::~Range()
 {
 }
index e177118..1467874 100644 (file)
@@ -50,6 +50,7 @@ class Range : public Shared<Range>
 public:
     Range(Document*);
     Range(Document*, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
+    Range(Document*, const Position&, const Position&);
     ~Range();
 
     Node* startContainer(ExceptionCode&) const;
index 5b6315a..94d07d0 100644 (file)
@@ -53,6 +53,7 @@
 #include "SplitElementCommand.h"
 #include "SplitTextNodeCommand.h"
 #include "SplitTextNodeContainingElementCommand.h"
+#include "TextIterator.h"
 #include "WrapContentsInDummySpanCommand.h"
 #include "htmlediting.h"
 #include "visible_units.h"
@@ -156,7 +157,7 @@ void CompositeEditCommand::insertNodeAfter(Node *insertChild, Node *refChild)
 
 void CompositeEditCommand::insertNodeAt(Node *insertChild, Node *refChild, int offset)
 {
-    if (refChild->hasChildNodes() || (refChild->renderer() && refChild->renderer()->isBlockFlow())) {
+    if (canHaveChildrenForEditing(refChild)) {
         Node *child = refChild->firstChild();
         for (int i = 0; child && i < offset; i++)
             child = child->nextSibling();
@@ -164,7 +165,7 @@ void CompositeEditCommand::insertNodeAt(Node *insertChild, Node *refChild, int o
             insertNodeBefore(insertChild, child);
         else
             appendNode(insertChild, refChild);
-    } 
+    }
     else if (refChild->caretMinOffset() >= offset) {
         insertNodeBefore(insertChild, refChild);
     } 
@@ -179,33 +180,11 @@ void CompositeEditCommand::insertNodeAt(Node *insertChild, Node *refChild, int o
 
 void CompositeEditCommand::appendNode(Node *appendChild, Node *parent)
 {
+    ASSERT(canHaveChildrenForEditing(parent));
     EditCommandPtr cmd(new AppendNodeCommand(document(), appendChild, parent));
     applyCommandToComposite(cmd);
 }
 
-void CompositeEditCommand::removeFullySelectedNode(Node *node)
-{
-    if (isTableStructureNode(node) || node == node->rootEditableElement()) {
-        // Do not remove an element of table structure; remove its contents.
-        // Likewise for the root editable element.
-        Node *child = node->firstChild();
-        while (child) {
-            Node *remove = child;
-            child = child->nextSibling();
-            removeFullySelectedNode(remove);
-        }
-        
-        // make sure empty cell has some height
-        updateLayout();
-        RenderObject *r = node->renderer();
-        if (r && r->isTableCell() && r->contentHeight() <= 0)
-            insertBlockPlaceholder(Position(node,0));
-        return;
-    }
-    
-    removeNode(node);
-}
-
 void CompositeEditCommand::removeChildrenInRange(Node *node, int from, int to)
 {
     Node *nodeToRemove = node->childNode(from);
@@ -544,45 +523,16 @@ Node *CompositeEditCommand::addBlockPlaceholderIfNeeded(Node *node)
     return NULL;
 }
 
-bool CompositeEditCommand::removeBlockPlaceholder(Node *node)
+bool CompositeEditCommand::removeBlockPlaceholder(const VisiblePosition& visiblePosition)
 {
-    Node *placeholder = findBlockPlaceholder(node);
-    if (placeholder) {
-        removeNode(placeholder);
+    Position downstream = visiblePosition.deepEquivalent().downstream();
+    if (downstream.node()->hasTagName(brTag) && downstream.offset() == 0 && isEndOfBlock(visiblePosition)) {
+        removeNode(downstream.node());
         return true;
     }
     return false;
 }
 
-// FIXME: This function should never be used.  If we're in a state where a webkit-block-placeholder
-// isn't the only thing in a block (there are bugs that can make this happen), this function will 
-// return a placeholder that might be far away from where the editing operation that's using it intends 
-// to operate.  Also a br is a placeholder if its acting like a placeholder, i.e. <div><br></div>, and 
-// this function only returs brs with our special class on them.
-Node *CompositeEditCommand::findBlockPlaceholder(Node *node)
-{
-    if (!node)
-        return 0;
-
-    updateLayout();
-
-    RenderObject *renderer = node->renderer();
-    if (!renderer || !renderer->isBlockFlow())
-        return 0;
-
-    for (Node *checkMe = node; checkMe; checkMe = checkMe->traverseNextNode(node)) {
-        if (checkMe->isElementNode()) {
-            Element *element = static_cast<Element *>(checkMe);
-            if (element->enclosingBlockFlowElement() == node && 
-                element->getAttribute(classAttr) == blockPlaceholderClassString()) {
-                return element;
-            }
-        }
-    }
-    
-    return 0;
-}
-
 void CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position &pos)
 {
     if (pos.isNull())
@@ -727,7 +677,7 @@ void CompositeEditCommand::moveParagraph(const VisiblePosition& startOfParagraph
         insertNodeAt(createBreakElement(document()).get(), beforeParagraph.deepEquivalent().node(), beforeParagraph.deepEquivalent().offset());
     
     setEndingSelection(destination);
-    EditCommandPtr cmd(new ReplaceSelectionCommand(document(), fragment.get(), false, false, false, true));
+    EditCommandPtr cmd(new ReplaceSelectionCommand(document(), fragment.get(), true, false, false, true));
     applyCommandToComposite(cmd);
 }
 
index 87717d0..5284b7c 100644 (file)
@@ -59,7 +59,7 @@ protected:
     void deleteKeyPressed();
     void deleteSelection(bool smartDelete=false, bool mergeBlocksAfterDelete=true);
     void deleteSelection(const Selection &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
-    void deleteTextFromNode(WebCore::Text *node, int offset, int count);
+    virtual void deleteTextFromNode(WebCore::Text *node, int offset, int count);
     void inputText(const WebCore::String &text, bool selectInsertedText = false);
     void insertNodeAfter(WebCore::Node *insertChild, WebCore::Node *refChild);
     void insertNodeAt(WebCore::Node *insertChild, WebCore::Node *refChild, int offset);
@@ -70,7 +70,6 @@ protected:
     void rebalanceWhitespace();
     void rebalanceWhitespaceAt(const WebCore::Position &position);
     void removeCSSProperty(WebCore::CSSStyleDeclaration *, int property);
-    void removeFullySelectedNode(WebCore::Node *node);
     void removeNodeAttribute(WebCore::Element *, const WebCore::QualifiedName& attribute);
     void removeChildrenInRange(WebCore::Node *node, int from, int to);
     void removeNode(WebCore::Node *removeChild);
@@ -94,8 +93,7 @@ protected:
     WebCore::Node *appendBlockPlaceholder(WebCore::Node *);
     WebCore::Node *insertBlockPlaceholder(const WebCore::Position &pos);
     WebCore::Node *addBlockPlaceholderIfNeeded(WebCore::Node *);
-    bool removeBlockPlaceholder(WebCore::Node *);
-    WebCore::Node *findBlockPlaceholder(WebCore::Node *);
+    bool removeBlockPlaceholder(const VisiblePosition&);
 
     void moveParagraphContentsToNewBlockIfNecessary(const WebCore::Position &);
     
index 4d90c2c..11dd8d6 100644 (file)
@@ -44,26 +44,6 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-static void debugPosition(const char *prefix, const Position &pos)
-{
-    if (!prefix)
-        prefix = "";
-    if (pos.isNull())
-        LOG(Editing, "%s <null>", prefix);
-    else
-        LOG(Editing, "%s%s %p : %d", prefix, pos.node()->nodeName().deprecatedString().latin1(), pos.node(), pos.offset());
-}
-
-static void debugNode(const char *prefix, const Node *node)
-{
-    if (!prefix)
-        prefix = "";
-    if (!node)
-        LOG(Editing, "%s <null>", prefix);
-    else
-        LOG(Editing, "%s%s %p", prefix, node->nodeName().deprecatedString().latin1(), node);
-}
-
 static Position positionBeforePossibleContainingSpecialElement(const Position &pos, Node **containingSpecialElement)
 {
     if (isFirstVisiblePositionInSpecialElement(pos))
@@ -85,7 +65,6 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document *document, bool smartDel
       m_mergeBlocksAfterDelete(mergeBlocksAfterDelete),
       m_startBlock(0),
       m_endBlock(0),
-      m_startNode(0),
       m_typingStyle(0),
       m_deleteIntoBlockquoteStyle(0)
 {
@@ -99,7 +78,6 @@ DeleteSelectionCommand::DeleteSelectionCommand(Document *document, const Selecti
       m_selectionToDelete(selection),
       m_startBlock(0),
       m_endBlock(0),
-      m_startNode(0),
       m_typingStyle(0),
       m_deleteIntoBlockquoteStyle(0)
 {
@@ -118,16 +96,13 @@ void DeleteSelectionCommand::initializeStartEnd()
     m_upstreamEnd = positionAfterPossibleContainingSpecialElement(end.upstream(), 0);
     m_downstreamEnd = positionAfterPossibleContainingSpecialElement(end.downstream(), &endSpecialContainer);
  
-    // do not adjust start/end if one of them did not adjust, and the selection is entirely within the special element
-    if (m_upstreamStart == m_selectionToDelete.start().upstream() || m_downstreamEnd == m_selectionToDelete.end().downstream()) {
-        if (m_downstreamEnd.node()->isAncestor(startSpecialContainer) || m_upstreamStart.node()->isAncestor(endSpecialContainer)) {
-            start = m_selectionToDelete.start();
-            end = m_selectionToDelete.end();
-            m_upstreamStart = start.upstream();
-            m_downstreamStart = start.downstream();
-            m_upstreamEnd = end.upstream();
-            m_downstreamEnd = end.downstream();
-        }
+    if (!startSpecialContainer || !endSpecialContainer)  {
+        start = m_selectionToDelete.start();
+        end = m_selectionToDelete.end();
+        m_upstreamStart = start.upstream();
+        m_downstreamStart = start.downstream();
+        m_upstreamEnd = end.upstream();
+        m_downstreamEnd = end.downstream();
     }
 }
 
@@ -138,6 +113,14 @@ void DeleteSelectionCommand::initializePositionData()
     //
     initializeStartEnd();
     
+    // Usually the start and the end of the selection to delete are pulled together as a result of the deletion.
+    // When they're not, we choose one as the position to place the caret and to insert the placeholder.
+    VisiblePosition visibleEnd(m_downstreamEnd);
+    if (m_mergeBlocksAfterDelete && !isEndOfParagraph(visibleEnd))
+        m_endingPosition = m_downstreamEnd;
+    else
+        m_endingPosition = m_downstreamStart;
+        
     //
     // Handle leading and trailing whitespace, as well as smart delete adjustments to the selection
     //
@@ -183,52 +166,6 @@ void DeleteSelectionCommand::initializePositionData()
     //
     m_startBlock = m_downstreamStart.node()->enclosingBlockFlowElement();
     m_endBlock = m_upstreamEnd.node()->enclosingBlockFlowElement();
-    m_startNode = m_upstreamStart.node();
-
-    debugPosition("m_upstreamStart      ", m_upstreamStart);
-    debugPosition("m_downstreamStart    ", m_downstreamStart);
-    debugPosition("m_upstreamEnd        ", m_upstreamEnd);
-    debugPosition("m_downstreamEnd      ", m_downstreamEnd);
-    debugPosition("m_leadingWhitespace  ", m_leadingWhitespace);
-    debugPosition("m_trailingWhitespace ", m_trailingWhitespace);
-    debugNode(    "m_startBlock         ", m_startBlock.get());
-    debugNode(    "m_endBlock           ", m_endBlock.get());    
-    debugNode(    "m_startNode          ", m_startNode.get());    
-}
-
-void DeleteSelectionCommand::insertPlaceholderForAncestorBlockContent()
-{
-    // This code makes sure a line does not disappear when deleting in this case:
-    // <p>foo</p>bar<p>baz</p>
-    // Select "bar" and hit delete. If nothing is done, the line containing bar will disappear.
-    // It needs to be held open by inserting a placeholder.
-    // Also see:
-    // <rdar://problem/3928305> selecting an entire line and typing over causes new inserted text at top of document
-    //
-    // The checks below detect the case where the selection contains content in an ancestor block 
-    // surrounded by child blocks.
-    //
-    VisiblePosition visibleStart(m_upstreamStart, VP_DEFAULT_AFFINITY);
-    VisiblePosition beforeStart = visibleStart.previous();
-    Node *startBlock = enclosingBlockFlowElement(visibleStart);
-    Node *beforeStartBlock = enclosingBlockFlowElement(beforeStart);
-    
-    if (!beforeStart.isNull() &&
-        !inSameBlock(visibleStart, beforeStart) &&
-        beforeStartBlock->isAncestor(startBlock) &&
-        startBlock != m_upstreamStart.node()) {
-
-        VisiblePosition visibleEnd(m_downstreamEnd, VP_DEFAULT_AFFINITY);
-        VisiblePosition afterEnd = visibleEnd.next();
-        
-        if ((!afterEnd.isNull() && !inSameBlock(afterEnd, visibleEnd) && !inSameBlock(afterEnd, visibleStart)) ||
-            (m_downstreamEnd == m_selectionToDelete.end() && isEndOfParagraph(visibleEnd) && !m_downstreamEnd.node()->hasTagName(brTag))) {
-            RefPtr<Node> block = createDefaultParagraphElement(document());
-            insertNodeBefore(block.get(), m_upstreamStart.node());
-            addBlockPlaceholderIfNeeded(block.get());
-            m_endingPosition = Position(block.get(), 0);
-        }
-    }
 }
 
 void DeleteSelectionCommand::saveTypingStyleState()
@@ -251,7 +188,7 @@ void DeleteSelectionCommand::saveTypingStyleState()
 bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
 {
     // Check for special-case where the selection contains only a BR on a line by itself after another BR.
-    bool upstreamStartIsBR = m_startNode->hasTagName(brTag);
+    bool upstreamStartIsBR = m_upstreamStart.node()->hasTagName(brTag);
     bool downstreamStartIsBR = m_downstreamStart.node()->hasTagName(brTag);
     bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && m_downstreamStart.node() == m_upstreamEnd.node();
     if (isBROnLineByItself) {
@@ -269,9 +206,60 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
     return false;
 }
 
+void DeleteSelectionCommand::removeFullySelectedNode(Node *node)
+{
+    if (isTableStructureNode(node) || node == node->rootEditableElement()) {
+        // Do not remove an element of table structure; remove its contents.
+        // Likewise for the root editable element.
+        Node *child = node->firstChild();
+        while (child) {
+            Node *remove = child;
+            child = child->nextSibling();
+            removeFullySelectedNode(remove);
+        }
+        
+        // make sure empty cell has some height
+        updateLayout();
+        RenderObject *r = node->renderer();
+        if (r && r->isTableCell() && r->contentHeight() <= 0)
+            insertBlockPlaceholder(Position(node,0));
+        return;
+    }
+    
+    Position p = positionBeforeNode(node);
+    
+    if (node->parent() == m_endingPosition.node() && node->nodeIndex() < (unsigned)m_endingPosition.offset())
+        m_endingPosition = Position(m_endingPosition.node(), m_endingPosition.offset() - 1);
+    
+    removeNode(node);
+    
+    if (!m_endingPosition.node()->inDocument())
+        m_endingPosition = p;
+}
+
+void DeleteSelectionCommand::deleteTextFromNode(Text *node, int offset, int count)
+{
+    if (m_endingPosition.node() == node) {
+        if (m_endingPosition.offset() > offset + count)
+            m_endingPosition = Position(m_endingPosition.node(), m_endingPosition.offset() - count);
+        else if (m_endingPosition.offset() > offset)
+            m_endingPosition = Position(m_endingPosition.node(), offset);
+    }
+    
+    CompositeEditCommand::deleteTextFromNode(node, offset, count);
+}
+
 void DeleteSelectionCommand::handleGeneralDelete()
 {
     int startOffset = m_upstreamStart.offset();
+    Node* startNode = m_upstreamStart.node();
+    // Don't remove the block containing the start of the selection being deleted even if the selection
+    // starts at the start of that block.
+    if (startNode->enclosingBlockFlowElement() && startNode->firstChild()) {
+        startOffset = 0;
+        startNode = startNode->firstChild();
+    }
+    
     VisiblePosition visibleEnd = VisiblePosition(m_downstreamEnd, m_selectionToDelete.affinity());
     bool endAtEndOfBlock = isEndOfBlock(visibleEnd);
 
@@ -289,69 +277,69 @@ void DeleteSelectionCommand::handleGeneralDelete()
     // If the entire start block is selected, and the selection does not extend to the end of the 
     // end of a block other than the block containing the selection start, then do not delete the 
     // start block, otherwise delete the start block.
-    if (startOffset == 1 && m_startNode && m_startNode->hasTagName(brTag)) {
-        m_startNode = m_startNode->traverseNextNode();
+    if (startOffset == 1 && startNode && startNode->hasTagName(brTag)) {
+        startNode = startNode->traverseNextNode();
         startOffset = 0;
     }
     if (m_startBlock != m_endBlock && isStartOfBlock(VisiblePosition(m_upstreamStart, m_selectionToDelete.affinity()))) {
         if (!m_startBlock->isAncestor(m_endBlock.get()) && !isStartOfBlock(visibleEnd) && endAtEndOfBlock) {
             // Delete all the children of the block, but not the block itself.
             // Use traverseNextNode in case the block has no children (e.g. is an empty table cell)
-            m_startNode = m_startBlock->traverseNextNode();
+            startNode = m_startBlock->traverseNextNode();
             startOffset = 0;
         }
-    }  else if (startOffset >= m_startNode->caretMaxOffset() && (isAtomicNode(m_startNode.get()) || startOffset == 0)) {
+    }  else if (startOffset >= startNode->caretMaxOffset() && (isAtomicNode(startNode) || startOffset == 0)) {
         // Move the start node to the next node in the tree since the startOffset is equal to
         // or beyond the start node's caretMaxOffset This means there is nothing visible to delete. 
         // But don't do this if the node is not atomic - we don't want to move into the first child.
 
         // Also, before moving on, delete any insignificant text that may be present in a text node.
-        if (m_startNode->isTextNode()) {
+        if (startNode->isTextNode()) {
             // Delete any insignificant text from this node.
-            Text *text = static_cast<Text *>(m_startNode.get());
-            if (text->length() > (unsigned)m_startNode->caretMaxOffset())
-                deleteTextFromNode(text, m_startNode->caretMaxOffset(), text->length() - m_startNode->caretMaxOffset());
+            Text *text = static_cast<Text *>(startNode);
+            if (text->length() > (unsigned)startNode->caretMaxOffset())
+                deleteTextFromNode(text, startNode->caretMaxOffset(), text->length() - startNode->caretMaxOffset());
         }
         
         // shift the start node to the next
-        m_startNode = m_startNode->traverseNextNode();
+        startNode = startNode->traverseNextNode();
         startOffset = 0;
     }
 
     // Done adjusting the start.  See if we're all done.
-    if (!m_startNode)
+    if (!startNode)
         return;
 
-    if (m_startNode == m_downstreamEnd.node()) {
+    if (startNode == m_downstreamEnd.node()) {
         // The selection to delete is all in one node.
-        if (!m_startNode->renderer() || 
-            (startOffset == 0 && m_downstreamEnd.offset() >= maxDeepOffset(m_startNode.get()))) {
+        if (!startNode->renderer() || 
+            (startOffset == 0 && m_downstreamEnd.offset() >= maxDeepOffset(startNode))) {
             // just delete
-            removeFullySelectedNode(m_startNode.get());
+            removeFullySelectedNode(startNode);
         } else if (m_downstreamEnd.offset() - startOffset > 0) {
-            if (m_startNode->isTextNode()) {
+            if (startNode->isTextNode()) {
                 // in a text node that needs to be trimmed
-                Text *text = static_cast<Text *>(m_startNode.get());
+                Text *text = static_cast<Text *>(startNode);
                 deleteTextFromNode(text, startOffset, m_downstreamEnd.offset() - startOffset);
                 m_trailingWhitespaceValid = false;
             } else {
-                removeChildrenInRange(m_startNode.get(), startOffset, m_downstreamEnd.offset());
+                removeChildrenInRange(startNode, startOffset, m_downstreamEnd.offset());
                 m_endingPosition = m_upstreamStart;
             }
         }
     }
     else {
         // The selection to delete spans more than one node.
-        Node *node = m_startNode.get();
+        Node *node = startNode;
         
         if (startOffset > 0) {
-            if (m_startNode->isTextNode()) {
+            if (startNode->isTextNode()) {
                 // in a text node that needs to be trimmed
                 Text *text = static_cast<Text *>(node);
                 deleteTextFromNode(text, startOffset, text->length() - startOffset);
                 node = node->traverseNextNode();
             } else {
-                node = m_startNode->childNode(startOffset);
+                node = startNode->childNode(startOffset);
             }
         }
         
@@ -371,21 +359,18 @@ void DeleteSelectionCommand::handleGeneralDelete()
                 removeFullySelectedNode(node);
                 node = nextNode;
             } else {
-                Node *n = node->lastChild();
-                while (n && n->lastChild())
-                    n = n->lastChild();
-                if (n == m_downstreamEnd.node() && m_downstreamEnd.offset() >= m_downstreamEnd.node()->caretMaxOffset()) {
-                    removeFullySelectedNode(node);
+                Node* n = node->lastDescendant();
+                if (m_downstreamEnd.node() == n && m_downstreamEnd.offset() >= n->caretMaxOffset()) {
+                    removeFullySelectedNode(node); 
                     m_trailingWhitespaceValid = false;
                     node = 0;
-                } 
-                else {
+                } else {
                     node = node->traverseNextNode();
                 }
             }
         }
         
-        if (m_downstreamEnd.node() != m_startNode && !m_upstreamStart.node()->isAncestor(m_downstreamEnd.node()) && m_downstreamEnd.node()->inDocument() && m_downstreamEnd.offset() >= m_downstreamEnd.node()->caretMinOffset()) {
+        if (m_downstreamEnd.node() != startNode && !m_upstreamStart.node()->isAncestor(m_downstreamEnd.node()) && m_downstreamEnd.node()->inDocument() && m_downstreamEnd.offset() >= m_downstreamEnd.node()->caretMinOffset()) {
             if (m_downstreamEnd.offset() >= maxDeepOffset(m_downstreamEnd.node())) {
                 // need to delete whole node
                 // we can get here if this is the last node in the block
@@ -504,32 +489,9 @@ void DeleteSelectionCommand::mergeParagraphs()
     
     if (mergeDestination == endOfParagraphToMove)
         return;
-        
-    moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination);
-}
-
-void DeleteSelectionCommand::calculateEndingPosition()
-{
-    if (m_endingPosition.isNotNull() && m_endingPosition.node()->inDocument())
-        return;
-
-    m_endingPosition = m_upstreamStart;
-    if (m_endingPosition.node()->inDocument())
-        return;
     
-    m_endingPosition = m_downstreamEnd;
-    if (m_endingPosition.node()->inDocument())
-        return;
-
-    m_endingPosition = Position(m_startBlock.get(), 0);
-    if (m_endingPosition.node()->inDocument())
-        return;
-
-    m_endingPosition = Position(m_endBlock.get(), 0);
-    if (m_endingPosition.node()->inDocument())
-        return;
-
-    m_endingPosition = Position(document()->documentElement(), 0);
+    moveParagraph(startOfParagraphToMove, endOfParagraphToMove, mergeDestination);
+    m_endingPosition = endingSelection().start();
 }
 
 void DeleteSelectionCommand::calculateTypingStyleAfterDelete(Node *insertedPlaceholder)
@@ -599,6 +561,11 @@ void DeleteSelectionCommand::doApply()
     // save this to later make the selection with
     EAffinity affinity = m_selectionToDelete.affinity();
     
+    Position downstreamEnd = m_selectionToDelete.end().downstream();
+    bool forceBlankParagraph = isStartOfParagraph(m_selectionToDelete.visibleStart()) &&
+                               isEndOfParagraph(m_selectionToDelete.visibleEnd()) &&
+                               !(downstreamEnd.node()->hasTagName(brTag) && downstreamEnd.offset() == 0);
+    
     // set up our state
     initializePositionData();
     if (!m_startBlock || !m_endBlock) {
@@ -611,11 +578,6 @@ void DeleteSelectionCommand::doApply()
         return;
     }
 
-    // if all we are deleting is complete paragraph(s), we need to make
-    // sure a blank paragraph remains when we are done
-    bool forceBlankParagraph = isStartOfParagraph(VisiblePosition(m_upstreamStart)) &&
-                               isEndOfParagraph(VisiblePosition(m_downstreamEnd));
-
     // Delete any text that may hinder our ability to fixup whitespace after the delete
     deleteInsignificantTextDownstream(m_trailingWhitespace);    
 
@@ -625,38 +587,29 @@ void DeleteSelectionCommand::doApply()
     // want to replace it with a placeholder BR!
     if (handleSpecialCaseBRDelete()) {
         calculateTypingStyleAfterDelete(false);
-        debugPosition("endingPosition   ", m_endingPosition);
         setEndingSelection(Selection(m_endingPosition, affinity));
         clearTransientState();
         rebalanceWhitespace();
         return;
     }
     
-    insertPlaceholderForAncestorBlockContent();
     handleGeneralDelete();
     
     mergeParagraphs();
     
-    calculateEndingPosition();
     fixupWhitespace();
-
-    // if the m_endingPosition is already a blank paragraph, there is
-    // no need to force a new one
-    if (forceBlankParagraph &&
-        isStartOfParagraph(VisiblePosition(m_endingPosition, VP_DEFAULT_AFFINITY)) &&
-        isEndOfParagraph(VisiblePosition(m_endingPosition, VP_DEFAULT_AFFINITY))) {
-        forceBlankParagraph = false;
-    }
     
-    Node *addedPlaceholder = forceBlankParagraph ? insertBlockPlaceholder(m_endingPosition) :
-        addBlockPlaceholderIfNeeded(m_endingPosition.node());
-
-    calculateTypingStyleAfterDelete(addedPlaceholder);
+    VisiblePosition visibleEndingPosition(m_endingPosition);
+    RefPtr<Node> placeholder = forceBlankParagraph  ? 
+                               createBreakElement(document()) : 0;
+    if (placeholder)
+        insertNodeAt(placeholder.get(), m_endingPosition.node(), m_endingPosition.offset());
 
-    debugPosition("endingPosition   ", m_endingPosition);
+    calculateTypingStyleAfterDelete(placeholder.get());
+    
+    rebalanceWhitespaceAt(m_endingPosition);
     setEndingSelection(Selection(m_endingPosition, affinity));
     clearTransientState();
-    rebalanceWhitespace();
 }
 
 EditAction DeleteSelectionCommand::editingAction() const
index e2f742c..f4972e5 100644 (file)
@@ -53,6 +53,8 @@ private:
     void calculateEndingPosition();
     void calculateTypingStyleAfterDelete(WebCore::Node *insertedPlaceholder);
     void clearTransientState();
+    void removeFullySelectedNode(Node* node);
+    virtual void deleteTextFromNode(Text *node, int offset, int count);
 
     bool m_hasSelectionToDelete;
     bool m_smartDelete;
@@ -70,7 +72,6 @@ private:
     WebCore::Position m_trailingWhitespace;
     RefPtr<WebCore::Node> m_startBlock;
     RefPtr<WebCore::Node> m_endBlock;
-    RefPtr<WebCore::Node> m_startNode;
     RefPtr<WebCore::CSSMutableStyleDeclaration> m_typingStyle;
     RefPtr<WebCore::CSSMutableStyleDeclaration> m_deleteIntoBlockquoteStyle;
 };
index 361ce9a..51cfe59 100644 (file)
@@ -101,22 +101,16 @@ void InsertLineBreakCommand::doApply()
         // This makes the "real" BR we want to insert appear in the rendering without any 
         // significant side effects (and no real worries either since you can't arrow past 
         // this extra one.
-        if (pos.node()->hasTagName(brTag) && pos.offset() == 0) {
-            // Already placed in a trailing BR. Insert "real" BR before it and leave the selection alone.
-            insertNodeBefore(nodeToInsert, pos.node());
-        } else {
-            Node *next = pos.node()->traverseNextNode();
-            bool hasTrailingBR = next && next->hasTagName(brTag) && pos.node()->enclosingBlockFlowElement() == next->enclosingBlockFlowElement();
-            insertNodeAfterPosition(nodeToInsert, pos);
-            if (hasTrailingBR)
-                setEndingSelection(Selection(Position(next, 0), DOWNSTREAM));
-            else if (!document()->inStrictMode()) {
-                // Insert an "extra" BR at the end of the block. 
-                RefPtr<Element> extraBreakNode = createBreakElement(document());
-                insertNodeAfter(extraBreakNode.get(), nodeToInsert);
-                setEndingSelection(Position(extraBreakNode.get(), 0), DOWNSTREAM);
-            }
-        }
+        
+        Node* block = pos.node()->enclosingBlockFlowElement();
+        
+        if (!document()->inStrictMode() && !(pos.downstream().node()->hasTagName(brTag) && pos.downstream().offset() == 0)) {
+            insertNodeAt(nodeToInsert, pos.node(), pos.offset());
+            insertNodeAfter(createBreakElement(document()).get(), nodeToInsert);
+        } else
+            insertNodeAt(nodeToInsert, pos.node(), pos.offset());
+            
+        setEndingSelection(Position(block, maxDeepOffset(block)), DOWNSTREAM);
     }
     else if (pos.offset() <= pos.node()->caretMinOffset()) {
         LOG(Editing, "input newline case 2");
index 74a1782..3261ed9 100644 (file)
@@ -142,7 +142,7 @@ void InsertParagraphSeparatorCommand::doApply()
     // Delete the current selection.
     if (selection.isRange()) {
         calculateStyleBeforeInsertion(pos);
-        deleteSelection(false, false);
+        deleteSelection(false, true);
         pos = endingSelection().start();
         affinity = endingSelection().affinity();
     }
index 4611e45..a397c2e 100644 (file)
@@ -115,12 +115,12 @@ void InsertTextCommand::input(const String &text, bool selectInsertedText)
     if (text == "\t") {
         endPosition = insertTab(startPosition);
         startPosition = endPosition.previous();
-        removeBlockPlaceholder(startPosition.node()->enclosingBlockFlowElement());
+        removeBlockPlaceholder(VisiblePosition(startPosition));
         m_charactersAdded += 1;
     } else {
         // Make sure the document is set up to receive text
         startPosition = prepareForTextInsertion(startPosition);
-        removeBlockPlaceholder(startPosition.node()->enclosingBlockFlowElement());
+        removeBlockPlaceholder(VisiblePosition(startPosition));
         Text *textNode = static_cast<Text *>(startPosition.node());
         int offset = startPosition.offset();
 
index e24b2fc..ffa76f2 100644 (file)
@@ -87,10 +87,13 @@ void RebalanceWhitespaceCommand::doUnapply()
         return;
     
     ASSERT(m_position.node()->isTextNode());
-    Text *textNode = static_cast<Text *>(m_position.node());
-    String text = textNode->data();
-    text.remove(m_upstreamOffset, m_afterString.length());
-    text.insert(m_beforeString, m_upstreamOffset);
+    
+    Text* node = static_cast<Text*>(m_position.node());
+    ExceptionCode ec = 0;
+    node->deleteData(m_upstreamOffset, m_afterString.length(), ec);
+    ASSERT(!ec);
+    node->insertData(m_upstreamOffset, m_beforeString, ec);
+    ASSERT(!ec);
 }
 
 bool RebalanceWhitespaceCommand::preservesTypingStyle() const
index e9604e1..becb089 100644 (file)
@@ -552,10 +552,11 @@ void ReplaceSelectionCommand::doApply()
     
     // delete the current range selection, or insert paragraph for caret selection, as needed
     if (selection.isRange()) {
-        // When the end of the selection to delete is at the end of a paragraph, and the selection
-        // to delete spans multiple blocks, not merging will leave an empty line containing the
-        // end of the selection to delete.
-        bool mergeBlocksAfterDelete = !fragment.hasInterchangeNewlineAtEnd() && !fragment.hasInterchangeNewlineAtStart() && isEndOfParagraph(visibleEnd);
+        // When the end of the selection being pasted into is at the end of a paragraph, and that selection
+        // spans multiple blocks, not merging will leave an empty line.
+        // When the start of the selection being pasted into is at the start of a paragraph, and starts at the
+        // start of a block, not merging will leave hanging block(s).
+        bool mergeBlocksAfterDelete = isEndOfParagraph(visibleEnd) || isStartOfBlock(visibleStart);
         deleteSelection(false, mergeBlocksAfterDelete);
         updateLayout();
         visibleStart = endingSelection().visibleStart();
@@ -829,28 +830,16 @@ void ReplaceSelectionCommand::completeHTMLReplacement(const Position &lastPositi
     Position end;
 
     if (m_firstNodeInserted && m_firstNodeInserted->inDocument() && m_lastNodeInserted && m_lastNodeInserted->inDocument()) {
-        // Find the last leaf.
-        Node *lastLeaf = m_lastNodeInserted.get();
-        while (1) {
-            Node *nextChild = lastLeaf->lastChild();
-            if (!nextChild)
-                break;
-            lastLeaf = nextChild;
-        }
-    
-        // Find the first leaf.
-        Node *firstLeaf = m_firstNodeInserted.get();
-        while (1) {
-            Node *nextChild = firstLeaf->firstChild();
-            if (!nextChild)
-                break;
-            firstLeaf = nextChild;
-        }
         
-        // Call updateLayout so caretMinOffset and caretMaxOffset return correct values.
-        updateLayout();
-        start = Position(firstLeaf, firstLeaf->caretMinOffset());
-        end = Position(lastLeaf, lastLeaf->caretMaxOffset());
+        Node* lastLeaf = m_lastNodeInserted->lastDescendant();
+        Node* firstLeaf = m_firstNodeInserted->firstDescendant();
+        
+        start = Position(firstLeaf, 0);
+        end = Position(lastLeaf, maxDeepOffset(lastLeaf));
+        
+        // FIXME: Should we treat all spaces in incoming content as having been rendered?
+        rebalanceWhitespaceAt(start);
+        rebalanceWhitespaceAt(end);
 
         if (m_matchStyle) {
             assert(m_insertionStyle);
@@ -868,8 +857,8 @@ void ReplaceSelectionCommand::completeHTMLReplacement(const Position &lastPositi
         setEndingSelection(Selection(start, end, SEL_DEFAULT_AFFINITY));
     else
         setEndingSelection(end, SEL_DEFAULT_AFFINITY);
-    
-    rebalanceWhitespace();
+        
+        
 }
 
 EditAction ReplaceSelectionCommand::editingAction() const
index 45897a1..b0463bb 100644 (file)
@@ -76,6 +76,15 @@ bool editingIgnoresContent(const Node *node)
     return false;
 }
 
+bool canHaveChildrenForEditing(const Node* node)
+{
+    return !node->hasTagName(hrTag) &&
+           !node->hasTagName(brTag) &&
+           !node->hasTagName(imgTag) &&
+           !node->hasTagName(buttonTag) &&
+           !node->isTextNode();
+}
+
 // antidote for maxDeepOffset()
 Position rangeCompliantEquivalent(const Position& pos)
 {
@@ -176,8 +185,11 @@ void rebalanceWhitespaceInTextNode(Node *node, unsigned int start, unsigned int
     if (start + length == text.length() && substring[end] == ' ')
         substring.replace(end, 1, nbsp);
     
-    text.remove(start, length);
-    text.insert(String(substring), start);
+    ExceptionCode ec = 0;
+    textNode->deleteData(start, length, ec);
+    ASSERT(!ec);
+    textNode->insertData(start, String(substring), ec);
+    ASSERT(!ec);
 }
 
 bool isTableStructureNode(const Node *node)
index 91d2558..4f7a33e 100644 (file)
@@ -44,6 +44,7 @@ Position rangeCompliantEquivalent(const VisiblePosition&);
 int maxDeepOffset(const Node*);
 bool isAtomicNode(const Node*);
 bool editingIgnoresContent(const Node*);
+bool canHaveChildrenForEditing(const Node*);
 
 void rebalanceWhitespaceInTextNode(Node*, unsigned start, unsigned length);
 const String& nonBreakingSpaceString();