Index: Source/WebCore/dom/Range.cpp |
=================================================================== |
--- Source/WebCore/dom/Range.cpp (revision 112601) |
+++ Source/WebCore/dom/Range.cpp (working copy) |
@@ -1036,11 +1036,15 @@ |
} |
bool collapsed = m_start == m_end; |
+ RefPtr<Node> container; |
if (startIsText) { |
- RefPtr<Text> newText = static_cast<Text*>(m_start.container())->splitText(m_start.offset(), ec); |
+ container = m_start.container(); |
+ RefPtr<Text> newText = static_cast<Text*>(container.get())->splitText(m_start.offset(), ec); |
if (ec) |
return; |
- m_start.container()->parentNode()->insertBefore(newNode.release(), newText.get(), ec); |
+ |
+ container = m_start.container(); |
+ container->parentNode()->insertBefore(newNode.release(), newText.get(), ec); |
if (ec) |
return; |
@@ -1054,7 +1058,8 @@ |
lastChild = (newNodeType == Node::DOCUMENT_FRAGMENT_NODE) ? newNode->lastChild() : newNode; |
int startOffset = m_start.offset(); |
- m_start.container()->insertBefore(newNode.release(), m_start.container()->childNode(startOffset), ec); |
+ container = m_start.container(); |
+ container->insertBefore(newNode.release(), container->childNode(startOffset), ec); |
if (ec) |
return; |