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

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

Issue 1950473002: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 3911 matching lines...) Expand 10 before | Expand all | Expand 10 after
3922 for (Range* range : m_ranges) 3922 for (Range* range : m_ranges)
3923 range->nodeWillBeRemoved(n); 3923 range->nodeWillBeRemoved(n);
3924 3924
3925 if (LocalFrame* frame = this->frame()) { 3925 if (LocalFrame* frame = this->frame()) {
3926 frame->eventHandler().nodeWillBeRemoved(n); 3926 frame->eventHandler().nodeWillBeRemoved(n);
3927 frame->selection().nodeWillBeRemoved(n); 3927 frame->selection().nodeWillBeRemoved(n);
3928 frame->page()->dragCaretController().nodeWillBeRemoved(n); 3928 frame->page()->dragCaretController().nodeWillBeRemoved(n);
3929 } 3929 }
3930 } 3930 }
3931 3931
3932 void Document::dataWillChange(const CharacterData& characterData)
3933 {
3934 if (LocalFrame* frame = this->frame())
3935 frame->selection().dataWillChange(characterData);
3936 }
3937
3932 void Document::didInsertText(Node* text, unsigned offset, unsigned length) 3938 void Document::didInsertText(Node* text, unsigned offset, unsigned length)
3933 { 3939 {
3934 for (Range* range : m_ranges) 3940 for (Range* range : m_ranges)
3935 range->didInsertText(text, offset, length); 3941 range->didInsertText(text, offset, length);
3936 3942
3937 m_markers->shiftMarkers(text, offset, length); 3943 m_markers->shiftMarkers(text, offset, length);
3938 } 3944 }
3939 3945
3940 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) 3946 void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
3941 { 3947 {
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
6035 #ifndef NDEBUG 6041 #ifndef NDEBUG
6036 using namespace blink; 6042 using namespace blink;
6037 void showLiveDocumentInstances() 6043 void showLiveDocumentInstances()
6038 { 6044 {
6039 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6045 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6040 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6046 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6041 for (Document* document : set) 6047 for (Document* document : set)
6042 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6048 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6043 } 6049 }
6044 #endif 6050 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698