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

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

Issue 1931513003: Invalidate the previous caret location when editing text nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after
3855 for (Range* range : m_ranges) 3855 for (Range* range : m_ranges)
3856 range->nodeWillBeRemoved(n); 3856 range->nodeWillBeRemoved(n);
3857 3857
3858 if (LocalFrame* frame = this->frame()) { 3858 if (LocalFrame* frame = this->frame()) {
3859 frame->eventHandler().nodeWillBeRemoved(n); 3859 frame->eventHandler().nodeWillBeRemoved(n);
3860 frame->selection().nodeWillBeRemoved(n); 3860 frame->selection().nodeWillBeRemoved(n);
3861 frame->page()->dragCaretController().nodeWillBeRemoved(n); 3861 frame->page()->dragCaretController().nodeWillBeRemoved(n);
3862 } 3862 }
3863 } 3863 }
3864 3864
3865 void Document::dataWillChange(const CharacterData& characterData)
3866 {
3867 if (LocalFrame* frame = this->frame())
3868 frame->selection().dataWillChange(characterData);
3869 }
3870
3865 void Document::didInsertText(Node* text, unsigned offset, unsigned length) 3871 void Document::didInsertText(Node* text, unsigned offset, unsigned length)
3866 { 3872 {
3867 for (Range* range : m_ranges) 3873 for (Range* range : m_ranges)
3868 range->didInsertText(text, offset, length); 3874 range->didInsertText(text, offset, length);
3869 3875
3870 m_markers->shiftMarkers(text, offset, length); 3876 m_markers->shiftMarkers(text, offset, length);
3871 } 3877 }
3872 3878
3873 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) 3879 void Document::didRemoveText(Node* text, unsigned offset, unsigned length)
3874 { 3880 {
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
5973 #ifndef NDEBUG 5979 #ifndef NDEBUG
5974 using namespace blink; 5980 using namespace blink;
5975 void showLiveDocumentInstances() 5981 void showLiveDocumentInstances()
5976 { 5982 {
5977 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5983 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5978 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5984 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5979 for (Document* document : set) 5985 for (Document* document : set)
5980 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5986 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5981 } 5987 }
5982 #endif 5988 #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