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

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

Issue 176863009: Have NodeWithIndex deal with references instead of pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/NodeWithIndex.h » ('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 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after
3660 HashSet<Range*>::const_iterator end = m_ranges.end(); 3660 HashSet<Range*>::const_iterator end = m_ranges.end();
3661 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it) 3661 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it)
3662 (*it)->didRemoveText(text, offset, length); 3662 (*it)->didRemoveText(text, offset, length);
3663 } 3663 }
3664 3664
3665 // Update the markers for spelling and grammar checking. 3665 // Update the markers for spelling and grammar checking.
3666 m_markers->removeMarkers(text, offset, length); 3666 m_markers->removeMarkers(text, offset, length);
3667 m_markers->shiftMarkers(text, offset + length, 0 - length); 3667 m_markers->shiftMarkers(text, offset + length, 0 - length);
3668 } 3668 }
3669 3669
3670 void Document::didMergeTextNodes(Text* oldNode, unsigned offset) 3670 void Document::didMergeTextNodes(Text& oldNode, unsigned offset)
3671 { 3671 {
3672 if (!m_ranges.isEmpty()) { 3672 if (!m_ranges.isEmpty()) {
3673 NodeWithIndex oldNodeWithIndex(oldNode); 3673 NodeWithIndex oldNodeWithIndex(oldNode);
3674 HashSet<Range*>::const_iterator end = m_ranges.end(); 3674 HashSet<Range*>::const_iterator end = m_ranges.end();
3675 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it) 3675 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it)
3676 (*it)->didMergeTextNodes(oldNodeWithIndex, offset); 3676 (*it)->didMergeTextNodes(oldNodeWithIndex, offset);
3677 } 3677 }
3678 3678
3679 if (m_frame) 3679 if (m_frame)
3680 m_frame->selection().didMergeTextNodes(*oldNode, offset); 3680 m_frame->selection().didMergeTextNodes(oldNode, offset);
3681 3681
3682 // FIXME: This should update markers for spelling and grammar checking. 3682 // FIXME: This should update markers for spelling and grammar checking.
3683 } 3683 }
3684 3684
3685 void Document::didSplitTextNode(Text* oldNode) 3685 void Document::didSplitTextNode(Text& oldNode)
3686 { 3686 {
3687 if (!m_ranges.isEmpty()) { 3687 if (!m_ranges.isEmpty()) {
3688 HashSet<Range*>::const_iterator end = m_ranges.end(); 3688 HashSet<Range*>::const_iterator end = m_ranges.end();
3689 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it) 3689 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; + +it)
3690 (*it)->didSplitTextNode(oldNode); 3690 (*it)->didSplitTextNode(oldNode);
3691 } 3691 }
3692 3692
3693 if (m_frame) 3693 if (m_frame)
3694 m_frame->selection().didSplitTextNode(*oldNode); 3694 m_frame->selection().didSplitTextNode(oldNode);
3695 3695
3696 // FIXME: This should update markers for spelling and grammar checking. 3696 // FIXME: This should update markers for spelling and grammar checking.
3697 } 3697 }
3698 3698
3699 void Document::setWindowAttributeEventListener(const AtomicString& eventType, Pa ssRefPtr<EventListener> listener) 3699 void Document::setWindowAttributeEventListener(const AtomicString& eventType, Pa ssRefPtr<EventListener> listener)
3700 { 3700 {
3701 DOMWindow* domWindow = this->domWindow(); 3701 DOMWindow* domWindow = this->domWindow();
3702 if (!domWindow) 3702 if (!domWindow)
3703 return; 3703 return;
3704 domWindow->setAttributeEventListener(eventType, listener); 3704 domWindow->setAttributeEventListener(eventType, listener);
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
5449 void Document::defaultEventHandler(Event* event) 5449 void Document::defaultEventHandler(Event* event)
5450 { 5450 {
5451 if (frame() && frame()->remotePlatformLayer()) { 5451 if (frame() && frame()->remotePlatformLayer()) {
5452 frame()->chromeClient().forwardInputEvent(this, event); 5452 frame()->chromeClient().forwardInputEvent(this, event);
5453 return; 5453 return;
5454 } 5454 }
5455 Node::defaultEventHandler(event); 5455 Node::defaultEventHandler(event);
5456 } 5456 }
5457 5457
5458 } // namespace WebCore 5458 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/NodeWithIndex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698