LayoutTests:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 00:35:05 +0000 (00:35 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 00:35:05 +0000 (00:35 +0000)
        Reviewed by harrison

        * editing/inserting/redo-expected.checksum: Added.
        * editing/inserting/redo-expected.png: Added.
        * editing/inserting/redo-expected.txt: Added.
        * editing/inserting/redo.html: Added.
        * editing/pasteboard/copy-paste-bidi-expected.txt:

WebCore:

        Reviewed by harrison

        <rdar://problem/4700341>
        REGRESSION: In new mail message, caret isn't placed at end of line after redoing typing

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Added a FIXME.
        * page/Frame.cpp:
        (WebCore::Frame::reappliedEditing): Restore the endingSelection(), not the startingSelection().

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

LayoutTests/ChangeLog
LayoutTests/editing/inserting/redo-expected.checksum [new file with mode: 0644]
LayoutTests/editing/inserting/redo-expected.png [new file with mode: 0644]
LayoutTests/editing/inserting/redo-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/redo.html [new file with mode: 0644]
LayoutTests/editing/pasteboard/copy-paste-bidi-expected.txt
WebCore/ChangeLog
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/page/Frame.cpp

index 0b547bd..f65550b 100644 (file)
@@ -1,3 +1,13 @@
+2006-08-28  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+
+        * editing/inserting/redo-expected.checksum: Added.
+        * editing/inserting/redo-expected.png: Added.
+        * editing/inserting/redo-expected.txt: Added.
+        * editing/inserting/redo.html: Added.
+        * editing/pasteboard/copy-paste-bidi-expected.txt:
+
 2006-08-28  Alice Liu  <alice.liu@apple.com>
 
         Reviewed by Geoff.
diff --git a/LayoutTests/editing/inserting/redo-expected.checksum b/LayoutTests/editing/inserting/redo-expected.checksum
new file mode 100644 (file)
index 0000000..3dd5a50
--- /dev/null
@@ -0,0 +1 @@
+b486dc303f66ca3808e6b8ceb3cc62e8
\ No newline at end of file
diff --git a/LayoutTests/editing/inserting/redo-expected.png b/LayoutTests/editing/inserting/redo-expected.png
new file mode 100644 (file)
index 0000000..f6c0477
Binary files /dev/null and b/LayoutTests/editing/inserting/redo-expected.png differ
diff --git a/LayoutTests/editing/inserting/redo-expected.txt b/LayoutTests/editing/inserting/redo-expected.txt
new file mode 100644 (file)
index 0000000..f79c17a
--- /dev/null
@@ -0,0 +1,21 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 48 of #text > DIV > BODY > HTML > #document to 48 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 48 of #text > DIV > BODY > HTML > #document to 48 of #text > 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 (0,0) size 784x18
+        RenderText {#text} at (0,0) size 294x18
+          text run at (0,0) width 294: "The caret should be at the end of this sentence."
+caret: position 48 of child 0 {#text} of child 0 {DIV} of child 0 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/inserting/redo.html b/LayoutTests/editing/inserting/redo.html
new file mode 100644 (file)
index 0000000..3e98c08
--- /dev/null
@@ -0,0 +1,8 @@
+<div id="test" contenteditable="true"></div>
+
+<script>
+window.getSelection().setPosition(document.getElementById("test"), 0);
+document.execCommand("InsertText", false, "The caret should be at the end of this sentence.");
+document.execCommand("Undo");
+document.execCommand("Redo");
+</script>
\ No newline at end of file
index c72a823..f647527 100644 (file)
@@ -45,7 +45,6 @@ layer at (0,0) size 800x600
               text run at (0,0) width 32: "1234"
               text run at (32,0) width 36 RTL: "\x{5E9}\x{5D3}\x{5D2}\x{5DB}"
               text run at (68,0) width 4: ":"
-          RenderBlock (anonymous) at (0,18) size 784x0
           RenderBlock {DIV} at (0,18) size 784x18
             RenderText {#text} at (712,0) size 72x18
               text run at (712,0) width 40 RTL: "\x{5E9}\x{5D3}\x{5D2}\x{5DB}:"
index 6eb8f87..ec8dac2 100644 (file)
@@ -1,3 +1,15 @@
+2006-08-28  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by harrison
+        
+        <rdar://problem/4700341>
+        REGRESSION: In new mail message, caret isn't placed at end of line after redoing typing
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply): Added a FIXME.
+        * page/Frame.cpp:
+        (WebCore::Frame::reappliedEditing): Restore the endingSelection(), not the startingSelection().
+
 2006-08-28  Tim Omernick  <timo@apple.com>
 
         Reviewed by John Sullivan.
index 2f154bd..fadc090 100644 (file)
@@ -568,7 +568,9 @@ void ReplaceSelectionCommand::doApply()
     if (shouldMergeStart(selectionStartWasStartOfParagraph, fragment.hasInterchangeNewlineAtStart())) {
         VisiblePosition destination = startOfInsertedContent.previous();
         VisiblePosition startOfParagraphToMove = startOfInsertedContent;
-
+        
+        // FIXME: Maintain positions for the start and end of inserted content instead of keeping nodes.  The nodes are
+        // only ever used to create positions where inserted content starts/ends.
         moveParagraph(startOfParagraphToMove, endOfParagraph(startOfParagraphToMove), destination);
         m_firstNodeInserted = endingSelection().visibleStart().deepEquivalent().downstream().node();
         if (!m_lastNodeInserted->inDocument())
index d7322fe..9ab151e 100644 (file)
@@ -2090,7 +2090,7 @@ void Frame::reappliedEditing(PassRefPtr<EditCommand> cmd)
 {
     dispatchEditableContentChangedEvents(*cmd);
 
-    SelectionController sel(cmd->startingSelection());
+    SelectionController sel(cmd->endingSelection());
     if (shouldChangeSelection(sel))
         setSelection(sel, true);