| Index: Source/core/dom/Document.cpp
 | 
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
 | 
| index 98f5e3733f544847224d93f872bcc783599a4557..542d376d2dc473167b0cffcdc62db1f8ab5c43b5 100644
 | 
| --- a/Source/core/dom/Document.cpp
 | 
| +++ b/Source/core/dom/Document.cpp
 | 
| @@ -3763,6 +3763,7 @@ void Document::moveNodeIteratorsToNewDocument(Node& node, Document& newDocument)
 | 
|  
 | 
|  void Document::updateRangesAfterChildrenChanged(ContainerNode* container)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
|          for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
 | 
| @@ -3772,6 +3773,7 @@ void Document::updateRangesAfterChildrenChanged(ContainerNode* container)
 | 
|  
 | 
|  void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      ASSERT(node.document() != this);
 | 
|      if (m_ranges.isEmpty())
 | 
|          return;
 | 
| @@ -3783,6 +3785,7 @@ void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node)
 | 
|  
 | 
|  void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      NoEventDispatchAssertion assertNoEventDispatch;
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
| @@ -3807,6 +3810,7 @@ void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
 | 
|  
 | 
|  void Document::nodeWillBeRemoved(Node& n)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
 | 
|      for (WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it)
 | 
|          (*it)->nodeWillBeRemoved(n);
 | 
| @@ -3826,6 +3830,7 @@ void Document::nodeWillBeRemoved(Node& n)
 | 
|  
 | 
|  void Document::didInsertText(Node* text, unsigned offset, unsigned length)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
|          for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
 | 
| @@ -3838,6 +3843,7 @@ void Document::didInsertText(Node* text, unsigned offset, unsigned length)
 | 
|  
 | 
|  void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
|          for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
 | 
| @@ -3851,6 +3857,7 @@ void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
 | 
|  
 | 
|  void Document::didMergeTextNodes(Text& oldNode, unsigned offset)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          NodeWithIndex oldNodeWithIndex(oldNode);
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
| @@ -3866,6 +3873,7 @@ void Document::didMergeTextNodes(Text& oldNode, unsigned offset)
 | 
|  
 | 
|  void Document::didSplitTextNode(Text& oldNode)
 | 
|  {
 | 
| +    ASSERT(!TemporaryRangeScope::active());
 | 
|      if (!m_ranges.isEmpty()) {
 | 
|          AttachedRangeSet::const_iterator end = m_ranges.end();
 | 
|          for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
 | 
| 
 |