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

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

Issue 2692093003: Rewrite DocumentMarkerController to use SynchronousMutationObserver (Closed)
Patch Set: Don't try to use -1 as default value for unsigned int 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 4236 matching lines...) Expand 10 before | Expand all | Expand 10 after
4247 notifyNodeWillBeRemoved(n); 4247 notifyNodeWillBeRemoved(n);
4248 4248
4249 if (containsV1ShadowTree()) 4249 if (containsV1ShadowTree())
4250 n.checkSlotChangeBeforeRemoved(); 4250 n.checkSlotChangeBeforeRemoved();
4251 4251
4252 if (n.inActiveDocument() && n.isElementNode()) 4252 if (n.inActiveDocument() && n.isElementNode())
4253 styleEngine().elementWillBeRemoved(toElement(n)); 4253 styleEngine().elementWillBeRemoved(toElement(n));
4254 } 4254 }
4255 4255
4256 void Document::didInsertText(Node* text, unsigned offset, unsigned length) { 4256 void Document::didInsertText(Node* text, unsigned offset, unsigned length) {
4257 for (Range* range : m_ranges) 4257 for (Range* range : m_ranges)
yosin_UTC9 2017/02/15 02:23:25 Note: We'll change Range to use didUpdateCharacter
4258 range->didInsertText(text, offset, length); 4258 range->didInsertText(text, offset, length);
4259
4260 m_markers->shiftMarkers(text, offset, length);
4261 } 4259 }
4262 4260
4263 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) { 4261 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) {
4264 for (Range* range : m_ranges) 4262 for (Range* range : m_ranges)
4265 range->didRemoveText(text, offset, length); 4263 range->didRemoveText(text, offset, length);
4266
4267 m_markers->removeMarkers(text, offset, length);
4268 m_markers->shiftMarkers(text, offset + length, 0 - length);
4269 } 4264 }
4270 4265
4271 void Document::didMergeTextNodes(const Text& mergedNode, 4266 void Document::didMergeTextNodes(const Text& mergedNode,
4272 const Text& nodeToBeRemoved, 4267 const Text& nodeToBeRemoved,
4273 unsigned oldLength) { 4268 unsigned oldLength) {
4274 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved)); 4269 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved));
4275 if (!m_ranges.isEmpty()) { 4270 if (!m_ranges.isEmpty()) {
4276 for (Range* range : m_ranges) 4271 for (Range* range : m_ranges)
4277 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength); 4272 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength);
4278 } 4273 }
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
6580 } 6575 }
6581 6576
6582 void showLiveDocumentInstances() { 6577 void showLiveDocumentInstances() {
6583 WeakDocumentSet& set = liveDocumentSet(); 6578 WeakDocumentSet& set = liveDocumentSet();
6584 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6579 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6585 for (blink::Document* document : set) 6580 for (blink::Document* document : set)
6586 fprintf(stderr, "- Document %p URL: %s\n", document, 6581 fprintf(stderr, "- Document %p URL: %s\n", document,
6587 document->url().getString().utf8().data()); 6582 document->url().getString().utf8().data());
6588 } 6583 }
6589 #endif 6584 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698