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

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

Issue 2001083002: Explicit management of FrameSelection availability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-08T18:08:39 Created 4 years, 6 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 | third_party/WebKit/Source/core/editing/DOMSelection.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 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 m_layoutView->setIsInWindow(true); 2104 m_layoutView->setIsInWindow(true);
2105 m_layoutView->setStyle(StyleResolver::styleForDocument(*this)); 2105 m_layoutView->setStyle(StyleResolver::styleForDocument(*this));
2106 m_layoutView->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfter CompositingInputChange); 2106 m_layoutView->compositor()->setNeedsCompositingUpdate(CompositingUpdateAfter CompositingInputChange);
2107 2107
2108 ContainerNode::attach(context); 2108 ContainerNode::attach(context);
2109 2109
2110 // The TextAutosizer can't update layout view info while the Document is det ached, so update now in case anything changed. 2110 // The TextAutosizer can't update layout view info while the Document is det ached, so update now in case anything changed.
2111 if (TextAutosizer* autosizer = textAutosizer()) 2111 if (TextAutosizer* autosizer = textAutosizer())
2112 autosizer->updatePageInfo(); 2112 autosizer->updatePageInfo();
2113 2113
2114 m_frame->selection().documentAttached(this);
2114 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean); 2115 m_lifecycle.advanceTo(DocumentLifecycle::StyleClean);
2115 } 2116 }
2116 2117
2117 void Document::detach(const AttachContext& context) 2118 void Document::detach(const AttachContext& context)
2118 { 2119 {
2119 TRACE_EVENT0("blink", "Document::detach"); 2120 TRACE_EVENT0("blink", "Document::detach");
2120 RELEASE_ASSERT(!m_frame || m_frame->tree().childCount() == 0); 2121 RELEASE_ASSERT(!m_frame || m_frame->tree().childCount() == 0);
2121 if (!isActive()) 2122 if (!isActive())
2122 return; 2123 return;
2123 2124
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 for (Node& node : NodeTraversal::descendantsOf(*this)) { 2197 for (Node& node : NodeTraversal::descendantsOf(*this)) {
2197 cache->remove(&node); 2198 cache->remove(&node);
2198 } 2199 }
2199 } 2200 }
2200 } 2201 }
2201 2202
2202 styleEngine().didDetach(); 2203 styleEngine().didDetach();
2203 2204
2204 frameHost()->eventHandlerRegistry().documentDetached(*this); 2205 frameHost()->eventHandlerRegistry().documentDetached(*this);
2205 2206
2207 m_frame->selection().documentDetached(*this);
2206 m_frame->inputMethodController().documentDetached(); 2208 m_frame->inputMethodController().documentDetached();
2207 2209
2208 // If this Document is associated with a live DocumentLoader, the 2210 // If this Document is associated with a live DocumentLoader, the
2209 // DocumentLoader will take care of clearing the FetchContext. Deferring 2211 // DocumentLoader will take care of clearing the FetchContext. Deferring
2210 // to the DocumentLoader when possible also prevents prematurely clearing 2212 // to the DocumentLoader when possible also prevents prematurely clearing
2211 // the context in the case where multiple Documents end up associated with 2213 // the context in the case where multiple Documents end up associated with
2212 // a single DocumentLoader (e.g., navigating to a javascript: url). 2214 // a single DocumentLoader (e.g., navigating to a javascript: url).
2213 if (!loader()) 2215 if (!loader())
2214 m_fetcher->clearContext(); 2216 m_fetcher->clearContext();
2215 // If this document is the master for an HTMLImportsController, sever that 2217 // If this document is the master for an HTMLImportsController, sever that
(...skipping 3767 matching lines...) Expand 10 before | Expand all | Expand 10 after
5983 #ifndef NDEBUG 5985 #ifndef NDEBUG
5984 using namespace blink; 5986 using namespace blink;
5985 void showLiveDocumentInstances() 5987 void showLiveDocumentInstances()
5986 { 5988 {
5987 WeakDocumentSet& set = liveDocumentSet(); 5989 WeakDocumentSet& set = liveDocumentSet();
5988 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5990 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5989 for (Document* document : set) 5991 for (Document* document : set)
5990 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5992 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5991 } 5993 }
5992 #endif 5994 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/DOMSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698