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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 332173003: Update owner document of Range objects if start/end boundary points in different document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-18T06:46:10 Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3752 matching lines...) Expand 10 before | Expand all | Expand 10 after
3763 3763
3764 void Document::updateRangesAfterChildrenChanged(ContainerNode* container) 3764 void Document::updateRangesAfterChildrenChanged(ContainerNode* container)
3765 { 3765 {
3766 if (!m_ranges.isEmpty()) { 3766 if (!m_ranges.isEmpty()) {
3767 AttachedRangeSet::const_iterator end = m_ranges.end(); 3767 AttachedRangeSet::const_iterator end = m_ranges.end();
3768 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it) 3768 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
3769 (*it)->nodeChildrenChanged(container); 3769 (*it)->nodeChildrenChanged(container);
3770 } 3770 }
3771 } 3771 }
3772 3772
3773 void Document::updateRangesAfterNodeMovedToAnotherDocument(const Node& node)
3774 {
3775 ASSERT(node.document() != this);
3776 if (m_ranges.isEmpty())
3777 return;
3778 AttachedRangeSet ranges = m_ranges;
3779 AttachedRangeSet::const_iterator end = ranges.end();
3780 for (AttachedRangeSet::const_iterator it = ranges.begin(); it != end; ++it)
3781 (*it)->updateOwnerDocumentIfNeeded();
3782 }
3783
3773 void Document::nodeChildrenWillBeRemoved(ContainerNode& container) 3784 void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
3774 { 3785 {
3775 NoEventDispatchAssertion assertNoEventDispatch; 3786 NoEventDispatchAssertion assertNoEventDispatch;
3776 if (!m_ranges.isEmpty()) { 3787 if (!m_ranges.isEmpty()) {
3777 AttachedRangeSet::const_iterator end = m_ranges.end(); 3788 AttachedRangeSet::const_iterator end = m_ranges.end();
3778 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it) 3789 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
3779 (*it)->nodeChildrenWillBeRemoved(container); 3790 (*it)->nodeChildrenWillBeRemoved(container);
3780 } 3791 }
3781 3792
3782 WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator nod eIteratorsEnd = m_nodeIterators.end(); 3793 WillBeHeapHashSet<RawPtrWillBeWeakMember<NodeIterator> >::const_iterator nod eIteratorsEnd = m_nodeIterators.end();
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
5854 visitor->trace(m_compositorPendingAnimations); 5865 visitor->trace(m_compositorPendingAnimations);
5855 visitor->trace(m_contextDocument); 5866 visitor->trace(m_contextDocument);
5856 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5867 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5857 DocumentSupplementable::trace(visitor); 5868 DocumentSupplementable::trace(visitor);
5858 TreeScope::trace(visitor); 5869 TreeScope::trace(visitor);
5859 ContainerNode::trace(visitor); 5870 ContainerNode::trace(visitor);
5860 ExecutionContext::trace(visitor); 5871 ExecutionContext::trace(visitor);
5861 } 5872 }
5862 5873
5863 } // namespace WebCore 5874 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698