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

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

Issue 2692093003: Rewrite DocumentMarkerController to use SynchronousMutationObserver (Closed)
Patch Set: Make requested changes, remove now-redundant block of code 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 4264 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 if (containsV1ShadowTree()) 4275 if (containsV1ShadowTree())
4276 n.checkSlotChangeBeforeRemoved(); 4276 n.checkSlotChangeBeforeRemoved();
4277 4277
4278 if (n.inActiveDocument() && n.isElementNode()) 4278 if (n.inActiveDocument() && n.isElementNode())
4279 styleEngine().elementWillBeRemoved(toElement(n)); 4279 styleEngine().elementWillBeRemoved(toElement(n));
4280 } 4280 }
4281 4281
4282 void Document::didInsertText(Node* text, unsigned offset, unsigned length) { 4282 void Document::didInsertText(Node* text, unsigned offset, unsigned length) {
4283 for (Range* range : m_ranges) 4283 for (Range* range : m_ranges)
4284 range->didInsertText(text, offset, length); 4284 range->didInsertText(text, offset, length);
4285
4286 m_markers->shiftMarkers(text, offset, length);
4287 } 4285 }
4288 4286
4289 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) { 4287 void Document::didRemoveText(Node* text, unsigned offset, unsigned length) {
4290 for (Range* range : m_ranges) 4288 for (Range* range : m_ranges)
4291 range->didRemoveText(text, offset, length); 4289 range->didRemoveText(text, offset, length);
4292
4293 m_markers->removeMarkers(text, offset, length);
4294 m_markers->shiftMarkers(text, offset + length, 0 - length);
4295 } 4290 }
4296 4291
4297 void Document::didMergeTextNodes(const Text& mergedNode, 4292 void Document::didMergeTextNodes(const Text& mergedNode,
4298 const Text& nodeToBeRemoved, 4293 const Text& nodeToBeRemoved,
4299 unsigned oldLength) { 4294 unsigned oldLength) {
4300 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved)); 4295 NodeWithIndex nodeToBeRemovedWithIndex(const_cast<Text&>(nodeToBeRemoved));
4301 if (!m_ranges.isEmpty()) { 4296 if (!m_ranges.isEmpty()) {
4302 for (Range* range : m_ranges) 4297 for (Range* range : m_ranges)
4303 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength); 4298 range->didMergeTextNodes(nodeToBeRemovedWithIndex, oldLength);
4304 } 4299 }
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after
6617 } 6612 }
6618 6613
6619 void showLiveDocumentInstances() { 6614 void showLiveDocumentInstances() {
6620 WeakDocumentSet& set = liveDocumentSet(); 6615 WeakDocumentSet& set = liveDocumentSet();
6621 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6616 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6622 for (blink::Document* document : set) 6617 for (blink::Document* document : set)
6623 fprintf(stderr, "- Document %p URL: %s\n", document, 6618 fprintf(stderr, "- Document %p URL: %s\n", document,
6624 document->url().getString().utf8().data()); 6619 document->url().getString().utf8().data());
6625 } 6620 }
6626 #endif 6621 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698