Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index a8a92c88fd49e58fd81d6a096f9c22cfb38f67fc..5c8fec02007e45a37f21ee1f7850f7f5a7c93e30 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -3770,6 +3770,17 @@ void Document::updateRangesAfterChildrenChanged(ContainerNode* container) |
| } |
| } |
| +void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node) |
| +{ |
| + ASSERT(node.document() != this); |
| + if (!m_ranges.isEmpty()) { |
|
Yuta Kitamura
2014/06/18 09:30:29
nit: Early exit is better here.
yosin_UTC9
2014/06/18 09:52:33
Done.
|
| + AttachedRangeSet ranges = m_ranges; |
| + AttachedRangeSet::const_iterator end = ranges.end(); |
| + for (AttachedRangeSet::const_iterator it = ranges.begin(); it != end; ++it) |
| + (*it)->updateOwnerDocumentIfNeeded(); |
| + } |
| +} |
| + |
| void Document::nodeChildrenWillBeRemoved(ContainerNode& container) |
| { |
| NoEventDispatchAssertion assertNoEventDispatch; |