Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: Source/WebCore/dom/Range.cpp

Issue 9948001: Merge 110487 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/split-text-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « LayoutTests/fast/text/split-text-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698