Source/WebCore: Build fix after r130411. Add the right offset.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 22:40:35 +0000 (22:40 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 22:40:35 +0000 (22:40 +0000)
Also use RefPtr instead of a raw pointer for next and previous pointers.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):

LayoutTests: Another rebaseline needed after r130411.

* platform/mac/editing/pasteboard/5006779-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/editing/pasteboard/5006779-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/editing/ReplaceSelectionCommand.cpp

index bf1e239..c7169b7 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-04  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Another rebaseline needed after r130411.
+
+        * platform/mac/editing/pasteboard/5006779-expected.txt:
+
 2012-10-04  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL] Add libxml 2.8.0 to jhbuild
index 54f8146..0509315 100644 (file)
@@ -21,4 +21,4 @@ layer at (0,0) size 800x600
         RenderBlock {BLOCKQUOTE} at (0,72) size 784x18 [color=#0000FF] [border: none (2px solid #0000FF)]
           RenderText {#text} at (12,0) size 83x18
             text run at (12,0) width 83: "Hello World."
-caret: position 2 of child 0 {#text} of child 2 {DIV} of body
+caret: position 3 of child 0 {#text} of child 2 {DIV} of body
index cdd4b8c..c821256 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-04  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Build fix after r130411. Add the right offset.
+        Also use RefPtr instead of a raw pointer for next and previous pointers.
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
+
 2012-10-04  Alec Flett  <alecflett@chromium.org>
 
         IndexedDB: promote objectstore/index backend ids to the frontend
index 047d470..0029335 100644 (file)
@@ -1253,35 +1253,35 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
         return;
 
     if (text->previousSibling() && text->previousSibling()->isTextNode()) {
-        Text* previous = toText(text->previousSibling());
+        RefPtr<Text> previous = toText(text->previousSibling());
         insertTextIntoNode(text, 0, previous->data());
 
         if (positionIsOffsetInAnchor)
             position.moveToOffset(previous->length() + position.offsetInContainerNode());
         else
-            updatePositionForNodeRemoval(position, previous);
+            updatePositionForNodeRemoval(position, previous.get());
 
         if (positionOnlyToBeUpdatedIsOffsetInAnchor) {
             if (positionOnlyToBeUpdated.containerNode() == text)
-                positionOnlyToBeUpdated.moveToOffset(previous->length() + position.offsetInContainerNode());
+                positionOnlyToBeUpdated.moveToOffset(previous->length() + positionOnlyToBeUpdated.offsetInContainerNode());
             else if (positionOnlyToBeUpdated.containerNode() == previous)
                 positionOnlyToBeUpdated.moveToPosition(text, position.offsetInContainerNode());
         } else
-            updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous);
+            updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous.get());
 
         removeNode(previous);
     }
     if (text->nextSibling() && text->nextSibling()->isTextNode()) {
-        Text* next = toText(text->nextSibling());
+        RefPtr<Text> next = toText(text->nextSibling());
         insertTextIntoNode(text, text->length(), next->data());
 
         if (!positionIsOffsetInAnchor)
-            updatePositionForNodeRemoval(position, next);
+            updatePositionForNodeRemoval(position, next.get());
 
         if (positionOnlyToBeUpdatedIsOffsetInAnchor && positionOnlyToBeUpdated.containerNode() == next)
             positionOnlyToBeUpdated.moveToPosition(text, text->length() + position.offsetInContainerNode());
         else
-            updatePositionForNodeRemoval(positionOnlyToBeUpdated, next);
+            updatePositionForNodeRemoval(positionOnlyToBeUpdated, next.get());
 
         removeNode(next);
     }