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

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

Issue 1995203002: Rewrite Shadow DOM distribution engine to support partial synchronous distribution for v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip 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 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after
3832 ni->nodeWillBeRemoved(n); 3832 ni->nodeWillBeRemoved(n);
3833 } 3833 }
3834 3834
3835 if (LocalFrame* frame = this->frame()) { 3835 if (LocalFrame* frame = this->frame()) {
3836 for (Node& n : NodeTraversal::childrenOf(container)) { 3836 for (Node& n : NodeTraversal::childrenOf(container)) {
3837 frame->eventHandler().nodeWillBeRemoved(n); 3837 frame->eventHandler().nodeWillBeRemoved(n);
3838 frame->selection().nodeWillBeRemoved(n); 3838 frame->selection().nodeWillBeRemoved(n);
3839 frame->page()->dragCaretController().nodeWillBeRemoved(n); 3839 frame->page()->dragCaretController().nodeWillBeRemoved(n);
3840 } 3840 }
3841 } 3841 }
3842
3843 if (containsV1ShadowTree()) {
3844 for (Node& n : NodeTraversal::childrenOf(container))
esprehn 2016/05/23 06:41:00 this traverses the whole subtree again whenever yo
hayato 2016/05/24 13:23:38 My intention to add this check code here, Document
3845 n.checkSlotChangeBeforeRemoved();
3846 }
3842 } 3847 }
3843 3848
3844 void Document::nodeWillBeRemoved(Node& n) 3849 void Document::nodeWillBeRemoved(Node& n)
3845 { 3850 {
3846 for (NodeIterator* ni : m_nodeIterators) 3851 for (NodeIterator* ni : m_nodeIterators)
3847 ni->nodeWillBeRemoved(n); 3852 ni->nodeWillBeRemoved(n);
3848 3853
3849 for (Range* range : m_ranges) 3854 for (Range* range : m_ranges)
3850 range->nodeWillBeRemoved(n); 3855 range->nodeWillBeRemoved(n);
3851 3856
3852 if (LocalFrame* frame = this->frame()) { 3857 if (LocalFrame* frame = this->frame()) {
3853 frame->eventHandler().nodeWillBeRemoved(n); 3858 frame->eventHandler().nodeWillBeRemoved(n);
3854 frame->selection().nodeWillBeRemoved(n); 3859 frame->selection().nodeWillBeRemoved(n);
3855 frame->page()->dragCaretController().nodeWillBeRemoved(n); 3860 frame->page()->dragCaretController().nodeWillBeRemoved(n);
3856 } 3861 }
3862
3863 if (containsV1ShadowTree())
3864 n.checkSlotChangeBeforeRemoved();
3857 } 3865 }
3858 3866
3859 void Document::dataWillChange(const CharacterData& characterData) 3867 void Document::dataWillChange(const CharacterData& characterData)
3860 { 3868 {
3861 if (LocalFrame* frame = this->frame()) 3869 if (LocalFrame* frame = this->frame())
3862 frame->selection().dataWillChange(characterData); 3870 frame->selection().dataWillChange(characterData);
3863 } 3871 }
3864 3872
3865 void Document::didInsertText(Node* text, unsigned offset, unsigned length) 3873 void Document::didInsertText(Node* text, unsigned offset, unsigned length)
3866 { 3874 {
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
6016 #ifndef NDEBUG 6024 #ifndef NDEBUG
6017 using namespace blink; 6025 using namespace blink;
6018 void showLiveDocumentInstances() 6026 void showLiveDocumentInstances()
6019 { 6027 {
6020 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 6028 Document::WeakDocumentSet& set = Document::liveDocumentSet();
6021 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6029 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6022 for (Document* document : set) 6030 for (Document* document : set)
6023 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6031 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6024 } 6032 }
6025 #endif 6033 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698