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

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-17T06:07:48 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
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 3835 matching lines...) Expand 10 before | Expand all | Expand 10 after
3846 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it) 3846 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
3847 (*it)->didMergeTextNodes(oldNodeWithIndex, offset); 3847 (*it)->didMergeTextNodes(oldNodeWithIndex, offset);
3848 } 3848 }
3849 3849
3850 if (m_frame) 3850 if (m_frame)
3851 m_frame->selection().didMergeTextNodes(oldNode, offset); 3851 m_frame->selection().didMergeTextNodes(oldNode, offset);
3852 3852
3853 // FIXME: This should update markers for spelling and grammar checking. 3853 // FIXME: This should update markers for spelling and grammar checking.
3854 } 3854 }
3855 3855
3856 void Document::didMoveNodeToNewDocument(const Node&)
3857 {
3858 if (!m_ranges.isEmpty()) {
3859 AttachedRangeSet ranges = m_ranges;
3860 AttachedRangeSet::const_iterator end = ranges.end();
3861 for (AttachedRangeSet::const_iterator it = ranges.begin(); it != end; ++ it)
3862 (*it)->updateOwnerDocumentIfNeeded();
3863 }
3864 }
3865
3856 void Document::didSplitTextNode(Text& oldNode) 3866 void Document::didSplitTextNode(Text& oldNode)
3857 { 3867 {
3858 if (!m_ranges.isEmpty()) { 3868 if (!m_ranges.isEmpty()) {
3859 AttachedRangeSet::const_iterator end = m_ranges.end(); 3869 AttachedRangeSet::const_iterator end = m_ranges.end();
3860 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it) 3870 for (AttachedRangeSet::const_iterator it = m_ranges.begin(); it != end; ++it)
3861 (*it)->didSplitTextNode(oldNode); 3871 (*it)->didSplitTextNode(oldNode);
3862 } 3872 }
3863 3873
3864 if (m_frame) 3874 if (m_frame)
3865 m_frame->selection().didSplitTextNode(oldNode); 3875 m_frame->selection().didSplitTextNode(oldNode);
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
5854 visitor->trace(m_compositorPendingAnimations); 5864 visitor->trace(m_compositorPendingAnimations);
5855 visitor->trace(m_contextDocument); 5865 visitor->trace(m_contextDocument);
5856 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5866 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5857 DocumentSupplementable::trace(visitor); 5867 DocumentSupplementable::trace(visitor);
5858 TreeScope::trace(visitor); 5868 TreeScope::trace(visitor);
5859 ContainerNode::trace(visitor); 5869 ContainerNode::trace(visitor);
5860 ExecutionContext::trace(visitor); 5870 ExecutionContext::trace(visitor);
5861 } 5871 }
5862 5872
5863 } // namespace WebCore 5873 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698