LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2006 22:21:59 +0000 (22:21 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 May 2006 22:21:59 +0000 (22:21 +0000)
        Reviewed by thatcher, levi

        Inserting an <hr> into <div>foo^bar</div> now produces
        <div>foo</div><hr><div>bar</div>, instead of <div>foo<hr>bar</div>,
        which means that removing an inserted <hr> programmatically from
        javascript produces a different visual result than before (the
        new result is arguably more correct):
        * editing/execCommand/insertHorizontalRule.html:
        * editing/execCommand/insertHorizontalRule-expected.checksum:
        * editing/execCommand/insertHorizontalRule-expected.png:
        * editing/execCommand/insertHorizontalRule-expected.txt:

        Equivalent render trees or changes in the editing delegate
        notifications that reflect the fact that we are doing an end
        merge more often:
        * editing/pasteboard/paste-text-001-expected.txt:
        * editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
        * editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
        * editing/pasteboard/paste-text-at-tabspan-003-expected.txt:
        * editing/pasteboard/smart-paste-003-expected.txt:
        * editing/pasteboard/smart-paste-004-expected.txt:
        * editing/pasteboard/smart-paste-005-expected.txt:
        * editing/pasteboard/smart-paste-006-expected.txt:
        * editing/pasteboard/smart-paste-007-expected.txt:
        * editing/style/smoosh-styles-001-expected.txt:
        * editing/style/smoosh-styles-002-expected.txt:

WebCore:

        Reviewed by thatcher, levi

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply):
        Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
        position pasted into must be split to avoid block nesting.  We now split unnecessarily
        some times, but the end merge cleans up for us.

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

18 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/insertHorizontalRule-expected.checksum
LayoutTests/editing/execCommand/insertHorizontalRule-expected.png
LayoutTests/editing/execCommand/insertHorizontalRule-expected.txt
LayoutTests/editing/execCommand/insertHorizontalRule.html
LayoutTests/editing/pasteboard/paste-text-001-expected.txt
LayoutTests/editing/pasteboard/paste-text-at-tabspan-001-expected.txt
LayoutTests/editing/pasteboard/paste-text-at-tabspan-002-expected.txt
LayoutTests/editing/pasteboard/paste-text-at-tabspan-003-expected.txt
LayoutTests/editing/pasteboard/smart-paste-003-expected.txt
LayoutTests/editing/pasteboard/smart-paste-004-expected.txt
LayoutTests/editing/pasteboard/smart-paste-005-expected.txt
LayoutTests/editing/pasteboard/smart-paste-006-expected.txt
LayoutTests/editing/pasteboard/smart-paste-007-expected.txt
LayoutTests/editing/style/smoosh-styles-001-expected.txt
LayoutTests/editing/style/smoosh-styles-002-expected.txt
WebCore/ChangeLog
WebCore/editing/ReplaceSelectionCommand.cpp

index 2d85365..5d95a8d 100644 (file)
@@ -1,3 +1,32 @@
+2006-05-11  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by thatcher, levi
+        
+        Inserting an <hr> into <div>foo^bar</div> now produces 
+        <div>foo</div><hr><div>bar</div>, instead of <div>foo<hr>bar</div>, 
+        which means that removing an inserted <hr> programmatically from 
+        javascript produces a different visual result than before (the 
+        new result is arguably more correct):
+        * editing/execCommand/insertHorizontalRule.html:
+        * editing/execCommand/insertHorizontalRule-expected.checksum:
+        * editing/execCommand/insertHorizontalRule-expected.png:
+        * editing/execCommand/insertHorizontalRule-expected.txt:
+        
+        Equivalent render trees or changes in the editing delegate
+        notifications that reflect the fact that we are doing an end
+        merge more often:
+        * editing/pasteboard/paste-text-001-expected.txt:
+        * editing/pasteboard/paste-text-at-tabspan-001-expected.txt:
+        * editing/pasteboard/paste-text-at-tabspan-002-expected.txt:
+        * editing/pasteboard/paste-text-at-tabspan-003-expected.txt:
+        * editing/pasteboard/smart-paste-003-expected.txt:
+        * editing/pasteboard/smart-paste-004-expected.txt:
+        * editing/pasteboard/smart-paste-005-expected.txt:
+        * editing/pasteboard/smart-paste-006-expected.txt:
+        * editing/pasteboard/smart-paste-007-expected.txt:
+        * editing/style/smoosh-styles-001-expected.txt:
+        * editing/style/smoosh-styles-002-expected.txt:
+
 2006-05-11  Darin Adler  <darin@apple.com>
 
         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
index ddb639d..33e4c13 100644 (file)
Binary files a/LayoutTests/editing/execCommand/insertHorizontalRule-expected.png and b/LayoutTests/editing/execCommand/insertHorizontalRule-expected.png differ
index f658187..cda43f5 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:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of HR > DIV > BODY > HTML > #document to 0 of HR > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of HR > DIV > BODY > HTML > #document to 0 of HR > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
@@ -15,7 +15,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of HR > DIV > BODY > HTML > #document to 0 of HR > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of HR > DIV > BODY > HTML > #document to 0 of HR > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -29,19 +29,21 @@ layer at (0,0) size 800x600
       RenderBlock {P} at (0,34) size 784x18
         RenderText {#text} at (0,0) size 282x18
           text run at (0,0) width 282: "This test inserts an hr between 'foo' and 'bar'."
-      RenderBlock {DIV} at (0,68) size 784x56 [border: (1px solid #0000FF)]
-        RenderBlock (anonymous) at (1,1) size 782x18
+      RenderBlock {DIV} at (0,68) size 784x54
+        RenderBlock (anonymous) at (0,0) size 784x18
           RenderText {#text} at (0,0) size 21x18
             text run at (0,0) width 21: "foo"
-        RenderBlock {HR} at (1,27) size 782x2 [border: (1px inset #000000)]
-        RenderBlock (anonymous) at (1,37) size 782x18
+        RenderBlock {HR} at (0,26) size 784x2 [border: (1px inset #000000)]
+        RenderBlock {DIV} at (0,36) size 784x18
           RenderText {#text} at (0,0) size 20x18
             text run at (0,0) width 20: "bar"
-      RenderBlock {P} at (0,140) size 784x18
+      RenderBlock {P} at (0,138) size 784x18
         RenderText {#text} at (0,0) size 634x18
           text run at (0,0) width 634: "This test inserts an hr with id=\"hr\" between 'foo' and 'bar', fetches the hr using its id, then removes it."
-      RenderBlock {DIV} at (0,174) size 784x20 [border: (1px solid #0000FF)]
-        RenderText {#text} at (1,1) size 21x18
-          text run at (1,1) width 21: "foo"
-        RenderText {#text} at (22,1) size 20x18
-          text run at (22,1) width 20: "bar"
+      RenderBlock {DIV} at (0,172) size 784x36
+        RenderBlock (anonymous) at (0,0) size 784x18
+          RenderText {#text} at (0,0) size 21x18
+            text run at (0,0) width 21: "foo"
+        RenderBlock {DIV} at (0,18) size 784x18
+          RenderText {#text} at (0,0) size 20x18
+            text run at (0,0) width 20: "bar"
index a5cfd85..122d927 100644 (file)
@@ -1,5 +1,3 @@
-<style>div { border: 1px solid blue; }</style>
-
 <p>These are tests for execCommand(InsertHorizontalRule).</p>
 
 <p>This test inserts an hr between 'foo' and 'bar'.</p>
index bbfbf8d..3da005d 100644 (file)
@@ -10,7 +10,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-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 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -22,10 +22,10 @@ layer at (0,0) size 800x600
         RenderInline {SPAN} at (0,0) size 140x28
           RenderText {#text} at (14,14) size 69x28
             text run at (14,14) width 69: "foo bar"
-          RenderInline {SPAN} at (0,0) size 31x28
+          RenderInline {SPAN} at (0,0) size 71x28
             RenderText {#text} at (83,14) size 31x28
               text run at (83,14) width 31: "bar"
-          RenderText {#text} at (114,14) size 40x28
-            text run at (114,14) width 40: " baz"
-        RenderText {#text} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 40x28
+              RenderText {#text} at (114,14) size 40x28
+                text run at (114,14) width 40: " baz"
 caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index fed393f..25d7f97 100644 (file)
@@ -19,13 +19,14 @@ layer at (0,0) size 800x600
         RenderInline {SPAN} at (0,0) size 155x28
           RenderText {#text} at (14,14) size 11x28
             text run at (14,14) width 11: "a"
-          RenderInline {SPAN} at (0,0) size 23x28
+          RenderInline {SPAN} at (0,0) size 144x28
             RenderText {#text} at (25,14) size 23x28
               text run at (25,14) width 23: "ax"
-          RenderInline {SPAN} at (0,0) size 110x28
-            RenderText {#text} at (48,14) size 110x28
-              text run at (48,14) width 110: "\x{9}\x{9}\x{9}"
-          RenderText {#text} at (158,14) size 11x28
-            text run at (158,14) width 11: "z"
-        RenderText {#text} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 121x28
+              RenderInline {SPAN} at (0,0) size 110x28
+                RenderText {#text} at (48,14) size 110x28
+                  text run at (48,14) width 110: "\x{9}\x{9}\x{9}"
+              RenderText {#text} at (158,14) size 11x28
+                text run at (158,14) width 11: "z"
+          RenderInline {SPAN} at (0,0) size 0x28
 caret: position 2 of child 0 {#text} of child 1 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 1c2e071..5d3ffeb 100644 (file)
@@ -5,7 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > 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 > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
@@ -23,13 +23,13 @@ layer at (0,0) size 800x600
           RenderInline {SPAN} at (0,0) size 37x28
             RenderText {#text} at (25,14) size 37x28
               text run at (25,14) width 37: "\x{9}"
-          RenderInline {SPAN} at (0,0) size 23x28
+          RenderInline {SPAN} at (0,0) size 107x28
             RenderText {#text} at (62,14) size 23x28
               text run at (62,14) width 23: "ax"
-          RenderInline {SPAN} at (0,0) size 73x28
-            RenderText {#text} at (85,14) size 73x28
-              text run at (85,14) width 73: "\x{9}\x{9}"
-          RenderText {#text} at (158,14) size 11x28
-            text run at (158,14) width 11: "z"
-        RenderText {#text} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 84x28
+              RenderInline {SPAN} at (0,0) size 73x28
+                RenderText {#text} at (85,14) size 73x28
+                  text run at (85,14) width 73: "\x{9}\x{9}"
+              RenderText {#text} at (158,14) size 11x28
+                text run at (158,14) width 11: "z"
 caret: position 2 of child 0 {#text} of child 2 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index 8d7329c..8ff9aaf 100644 (file)
@@ -25,10 +25,10 @@ layer at (0,0) size 800x600
           RenderInline {SPAN} at (0,0) size 133x28
             RenderText {#text} at (25,14) size 133x28
               text run at (25,14) width 133: "\x{9}\x{9}\x{9}"
-          RenderInline {SPAN} at (0,0) size 23x28
+          RenderInline {SPAN} at (0,0) size 34x28
             RenderText {#text} at (158,14) size 23x28
               text run at (158,14) width 23: "ax"
-          RenderText {#text} at (181,14) size 11x28
-            text run at (181,14) width 11: "z"
-        RenderText {#text} at (0,0) size 0x0
+            RenderInline {SPAN} at (0,0) size 11x28
+              RenderText {#text} at (181,14) size 11x28
+                text run at (181,14) width 11: "z"
 caret: position 2 of child 0 {#text} of child 2 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index cdbc608..fc3615e 100644 (file)
@@ -4,7 +4,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-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 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 e1ff3d0..b5fc81f 100644 (file)
@@ -5,7 +5,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-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 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 79d402e..dd64838 100644 (file)
@@ -6,7 +6,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > 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
 layer at (0,0) size 800x600
index 234624b..21927ae 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-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 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
 layer at (0,0) size 800x600
index 0621ee3..5539cbb 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-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 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 fd55c58..bd77ccd 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > FONT > SPAN > DIV > DIV > BODY > HTML > #document to 3 of #text > FONT > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > FONT > SPAN > DIV > DIV > BODY > HTML > #document to 3 of #text > FONT > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -50,9 +50,11 @@ layer at (0,0) size 800x600
           RenderInline {SPAN} at (0,0) size 77x28 [color=#FF0000]
             RenderText {#text} at (2,2) size 23x28
               text run at (2,2) width 23: "ab"
-            RenderInline {FONT} at (0,0) size 34x28 [color=#000000]
+            RenderInline {FONT} at (0,0) size 54x28 [color=#000000]
               RenderText {#text} at (25,2) size 34x28
                 text run at (25,2) width 34: "cde"
-            RenderText {#text} at (59,2) size 20x28
-              text run at (59,2) width 20: "fg"
+              RenderInline {SPAN} at (0,0) size 20x28
+                RenderInline {FONT} at (0,0) size 20x28 [color=#FF0000]
+                  RenderText {#text} at (59,2) size 20x28
+                    text run at (59,2) width 20: "fg"
 caret: position 3 of child 0 {#text} of child 1 {FONT} of child 1 {SPAN} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index d0c0270..e8e1ea2 100644 (file)
@@ -14,7 +14,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > B > SPAN > FONT > SPAN > DIV > DIV > BODY > HTML > #document to 3 of #text > B > SPAN > FONT > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > B > SPAN > FONT > SPAN > DIV > DIV > BODY > HTML > #document to 3 of #text > B > SPAN > FONT > SPAN > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -49,11 +49,14 @@ layer at (0,0) size 800x600
           RenderInline {SPAN} at (0,0) size 99x28 [color=#FF0000]
             RenderText {#text} at (2,8) size 29x28
               text run at (2,8) width 29: "ab"
-            RenderInline {FONT} at (0,0) size 46x37 [color=#000000]
-              RenderInline {SPAN} at (0,0) size 46x37
-                RenderInline {B} at (0,0) size 46x37
+            RenderInline {FONT} at (0,0) size 70x37 [color=#000000]
+              RenderInline {SPAN} at (0,0) size 70x37
+                RenderInline {B} at (0,0) size 70x37
                   RenderText {#text} at (31,2) size 46x37
                     text run at (31,2) width 46: "cde"
-            RenderText {#text} at (77,8) size 24x28
-              text run at (77,8) width 24: "fg"
+                  RenderInline {SPAN} at (0,0) size 24x37
+                    RenderInline {FONT} at (0,0) size 24x37 [color=#FF0000]
+                      RenderInline {SPAN} at (0,0) size 24x28
+                        RenderText {#text} at (77,8) size 24x28
+                          text run at (77,8) width 24: "fg"
 caret: position 3 of child 0 {#text} of child 0 {B} of child 0 {SPAN} of child 1 {FONT} of child 1 {SPAN} of child 1 {DIV} of child 3 {DIV} of child 1 {BODY} of child 0 {HTML} of document
index c4ea797..ec72cc8 100644 (file)
@@ -1,3 +1,13 @@
+2006-05-10  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by thatcher, levi
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply):
+        Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
+        position pasted into must be split to avoid block nesting.  We now split unnecessarily
+        some times, but the end merge cleans up for us.
+
 2006-05-11  David Hyatt  <hyatt@apple.com>
 
         This patch makes drawHighlightForText a completely cross-platform method
         clobber it.
         
         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
-        brs where [br, 0] is at the end of a block and not at the start of the paragraph
+        brs where [br, 0] is at the end of a block and not at the start of a paragraph
         are the ones that are collapsed because of quirks mode.
 
 2006-05-10  David Hyatt  <hyatt@apple.com>
index 3910d1c..1205f28 100644 (file)
@@ -577,7 +577,7 @@ void ReplaceSelectionCommand::doApply()
         // FIXME: If this code is really about preventing block nesting, then the check should be !isEndOfBlock(visibleStart) and we 
         // should split the block in two, instead of inserting a paragraph separator. In the meantime, it appears that code below 
         // depends on this split happening when the paste position is not the start or end of a paragraph.
-        if (fragment.hasMoreThanOneBlock() && !isEndOfParagraph(visibleStart) && !isStartOfParagraph(visibleStart)) {
+        if (!isEndOfParagraph(visibleStart) && !isStartOfParagraph(visibleStart)) {
             insertParagraphSeparator();
             setEndingSelection(VisiblePosition(endingSelection().start(), VP_DEFAULT_AFFINITY).previous());
         }