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

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

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Created 3 years, 10 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 4238 matching lines...) Expand 10 before | Expand all | Expand 10 after
4249 4249
4250 void Document::dataWillChange(const CharacterData& characterData) { 4250 void Document::dataWillChange(const CharacterData& characterData) {
4251 if (LocalFrame* frame = this->frame()) 4251 if (LocalFrame* frame = this->frame())
4252 frame->selection().dataWillChange(characterData); 4252 frame->selection().dataWillChange(characterData);
4253 } 4253 }
4254 4254
4255 void Document::didInsertText(Node* text, unsigned offset, unsigned length) { 4255 void Document::didInsertText(Node* text, unsigned offset, unsigned length) {
4256 for (Range* range : m_ranges) 4256 for (Range* range : m_ranges)
4257 range->didInsertText(text, offset, length); 4257 range->didInsertText(text, offset, length);
4258 4258
4259 m_markers->shiftMarkers(text, offset, length); 4259 m_markers->shiftMarkers(text, offset, 0, length);
4260 } 4260 }
4261 4261
4262 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) { 4262 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) {
4263 for (Range* range : m_ranges) 4263 for (Range* range : m_ranges)
4264 range->didRemoveText(text, offset, length); 4264 range->didRemoveText(text, offset, length);
4265 4265
4266 m_markers->removeMarkers(text, offset, length); 4266 m_markers->removeMarkers(text, offset, length);
4267 m_markers->shiftMarkers(text, offset + length, 0 - length); 4267 m_markers->shiftMarkers(text, offset, length, 0);
4268 } 4268 }
4269 4269
4270 void Document::didMergeTextNodes(const Text& mergedNode, 4270 void Document::didMergeTextNodes(const Text& mergedNode,
4271 const Text& nodeToBeRemoved, 4271 const Text& nodeToBeRemoved,
4272 unsigned oldLength) { 4272 unsigned oldLength) {
4273 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved)); 4273 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved));
4274 if (!m_ranges.isEmpty()) { 4274 if (!m_ranges.isEmpty()) {
4275 for (Range* range : m_ranges) 4275 for (Range* range : m_ranges)
4276 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength); 4276 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength);
4277 } 4277 }
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
6535 } 6535 }
6536 6536
6537 void showLiveDocumentInstances() { 6537 void showLiveDocumentInstances() {
6538 WeakDocumentSet& set = liveDocumentSet(); 6538 WeakDocumentSet& set = liveDocumentSet();
6539 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6539 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6540 for (Document* document : set) 6540 for (Document* document : set)
6541 fprintf(stderr, "- Document %p URL: %s\n", document, 6541 fprintf(stderr, "- Document %p URL: %s\n", document,
6542 document->url().getString().utf8().data()); 6542 document->url().getString().utf8().data());
6543 } 6543 }
6544 #endif 6544 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698