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

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

Issue 1213203002: Move AXObjectCache::remove so it is after ContainerNode::detach Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | Source/modules/accessibility/AXARIAGrid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 if (frameHost()) 2188 if (frameHost())
2189 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get (), nullptr); 2189 frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement.get (), nullptr);
2190 } 2190 }
2191 2191
2192 if (this == &axObjectCacheOwner()) 2192 if (this == &axObjectCacheOwner())
2193 clearAXObjectCache(); 2193 clearAXObjectCache();
2194 2194
2195 m_layoutView = nullptr; 2195 m_layoutView = nullptr;
2196 ContainerNode::detach(context); 2196 ContainerNode::detach(context);
2197 2197
2198 if (this != &axObjectCacheOwner()) {
2199 if (AXObjectCache* cache = existingAXObjectCache()) {
2200 // Documents that are not a root document use the AXObjectCache in
2201 // their root document. Node::removedFrom is called after the
2202 // document has been detached so it can't find the root document.
2203 // We do the removals here instead.
2204 for (Node& node : NodeTraversal::descendantsOf(*this)) {
2205 cache->remove(&node);
2206 }
2207 }
2208 }
2209
2198 styleEngine().didDetach(); 2210 styleEngine().didDetach();
2199 2211
2200 frameHost()->eventHandlerRegistry().documentDetached(*this); 2212 frameHost()->eventHandlerRegistry().documentDetached(*this);
2201 2213
2202 // If this Document is associated with a live DocumentLoader, the 2214 // If this Document is associated with a live DocumentLoader, the
2203 // DocumentLoader will take care of clearing the FetchContext. Deferring 2215 // DocumentLoader will take care of clearing the FetchContext. Deferring
2204 // to the DocumentLoader when possible also prevents prematurely clearing 2216 // to the DocumentLoader when possible also prevents prematurely clearing
2205 // the context in the case where multiple Documents end up associated with 2217 // the context in the case where multiple Documents end up associated with
2206 // a single DocumentLoader (e.g., navigating to a javascript: url). 2218 // a single DocumentLoader (e.g., navigating to a javascript: url).
2207 if (!loader()) 2219 if (!loader())
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
5770 #ifndef NDEBUG 5782 #ifndef NDEBUG
5771 using namespace blink; 5783 using namespace blink;
5772 void showLiveDocumentInstances() 5784 void showLiveDocumentInstances()
5773 { 5785 {
5774 WeakDocumentSet& set = liveDocumentSet(); 5786 WeakDocumentSet& set = liveDocumentSet();
5775 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5787 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5776 for (Document* document : set) 5788 for (Document* document : set)
5777 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5789 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5778 } 5790 }
5779 #endif 5791 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/modules/accessibility/AXARIAGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698