Unreviewed build fix after r150469. We need to bail out here when DOM is mutated...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 22:06:35 +0000 (22:06 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 May 2013 22:06:35 +0000 (22:06 +0000)
the split text nodes no longer exist right next to each other.

* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):

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

Source/WebCore/ChangeLog
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp

index f045a38..b3e4335 100644 (file)
@@ -1,3 +1,11 @@
+2013-05-21  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Unreviewed build fix after r150469. We need to bail out here when DOM is mutated by an event listener such that
+        the split text nodes no longer exist right next to each other.
+
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply):
+
 2013-05-21  Antti Koivisto  <antti@apple.com>
 
         Remove ScopeContentDistribution
index 64a5254..d3aaa1b 100644 (file)
@@ -336,6 +336,8 @@ void InsertParagraphSeparatorCommand::doApply()
         if (insertionPosition.deprecatedEditingOffset() > 0 && !atEnd) {
             splitTextNode(textNode, insertionPosition.offsetInContainerNode());
             positionAfterSplit = firstPositionInNode(textNode.get());
+            if (!textNode->previousSibling())
+                return; // Bail out if mutation events detachd the split text node.
             insertionPosition.moveToPosition(textNode->previousSibling(), insertionPosition.offsetInContainerNode());
             visiblePos = VisiblePosition(insertionPosition);
         }