summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/dom/Range.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/dom/Range.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/dom/Range.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebCore/dom/Range.cpp b/src/3rdparty/webkit/WebCore/dom/Range.cpp
index 8a3ca8f..4fb1164 100644
--- a/src/3rdparty/webkit/WebCore/dom/Range.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/Range.cpp
@@ -95,8 +95,8 @@ PassRefPtr<Range> Range::create(PassRefPtr<Document> ownerDocument, const Positi
Range::~Range()
{
- if (m_start.container())
- m_ownerDocument->detachRange(this);
+ // Always detach (even if we've already detached) to fix https://bugs.webkit.org/show_bug.cgi?id=26044
+ m_ownerDocument->detachRange(this);
#ifndef NDEBUG
rangeCounter.decrement();
@@ -379,7 +379,6 @@ Range::CompareResults Range::compareNode(Node* refNode, ExceptionCode& ec)
}
}
-
short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionCode& ec) const
{
if (!m_start.container()) {
@@ -1070,6 +1069,7 @@ PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& marku
void Range::detach(ExceptionCode& ec)
{
+ // Check first to see if we've already detached:
if (!m_start.container()) {
ec = INVALID_STATE_ERR;
return;