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

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

Issue 24430002: Rename attach and detach to createRenderTree/destroyRenderTree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 matchAuthorAndUserStyles = docSettings->authorAndUserStylesEnabled(); 1972 matchAuthorAndUserStyles = docSettings->authorAndUserStylesEnabled();
1973 m_styleResolver = adoptPtr(new StyleResolver(*this, matchAuthorAndUserStyles )); 1973 m_styleResolver = adoptPtr(new StyleResolver(*this, matchAuthorAndUserStyles ));
1974 m_styleEngine->combineCSSFeatureFlags(m_styleResolver->ruleFeatureSet()); 1974 m_styleEngine->combineCSSFeatureFlags(m_styleResolver->ruleFeatureSet());
1975 } 1975 }
1976 1976
1977 void Document::clearStyleResolver() 1977 void Document::clearStyleResolver()
1978 { 1978 {
1979 m_styleResolver.clear(); 1979 m_styleResolver.clear();
1980 } 1980 }
1981 1981
1982 void Document::attach(const AttachContext& context) 1982 void Document::createRenderTree(const AttachContext& context)
1983 { 1983 {
1984 ASSERT(!attached()); 1984 ASSERT(!attached());
1985 ASSERT(!m_axObjectCache || this != topDocument()); 1985 ASSERT(!m_axObjectCache || this != topDocument());
1986 1986
1987 // Create the rendering tree 1987 // Create the rendering tree
1988 setRenderer(new RenderView(this)); 1988 setRenderer(new RenderView(this));
1989 renderView()->setIsInWindow(true); 1989 renderView()->setIsInWindow(true);
1990 1990
1991 recalcStyle(Force); 1991 recalcStyle(Force);
1992 1992
1993 ContainerNode::attach(context); 1993 ContainerNode::createRenderTree(context);
1994 } 1994 }
1995 1995
1996 void Document::detach(const AttachContext& context) 1996 void Document::destroyRenderTree(const AttachContext& context)
1997 { 1997 {
1998 ASSERT(attached()); 1998 ASSERT(attached());
1999 1999
2000 if (page()) 2000 if (page())
2001 page()->documentDetached(this); 2001 page()->documentDetached(this);
2002 2002
2003 if (this == topDocument()) 2003 if (this == topDocument())
2004 clearAXObjectCache(); 2004 clearAXObjectCache();
2005 2005
2006 stopActiveDOMObjects(); 2006 stopActiveDOMObjects();
(...skipping 19 matching lines...) Expand all
2026 view->detachCustomScrollbars(); 2026 view->detachCustomScrollbars();
2027 } 2027 }
2028 2028
2029 // indicate destruction mode, i.e. attached() but renderer == 0 2029 // indicate destruction mode, i.e. attached() but renderer == 0
2030 setRenderer(0); 2030 setRenderer(0);
2031 2031
2032 m_hoverNode = 0; 2032 m_hoverNode = 0;
2033 m_focusedElement = 0; 2033 m_focusedElement = 0;
2034 m_activeElement = 0; 2034 m_activeElement = 0;
2035 2035
2036 ContainerNode::detach(context); 2036 ContainerNode::destroyRenderTree(context);
2037 2037
2038 unscheduleStyleRecalc(); 2038 unscheduleStyleRecalc();
2039 2039
2040 clearStyleResolver(); 2040 clearStyleResolver();
2041 2041
2042 if (render) 2042 if (render)
2043 render->destroy(); 2043 render->destroy();
2044 2044
2045 // This is required, as our Frame might delete itself as soon as it detaches 2045 // This is required, as our Frame might delete itself as soon as it detaches
2046 // us. However, this violates Node::detach() semantics, as it's never 2046 // us. However, this violates Node::detach() semantics, as it's never
(...skipping 12 matching lines...) Expand all
2059 { 2059 {
2060 disconnectDescendantFrames(); 2060 disconnectDescendantFrames();
2061 2061
2062 // The process of disconnecting descendant frames could have already 2062 // The process of disconnecting descendant frames could have already
2063 // detached us. 2063 // detached us.
2064 if (!attached()) 2064 if (!attached())
2065 return; 2065 return;
2066 2066
2067 if (DOMWindow* window = this->domWindow()) 2067 if (DOMWindow* window = this->domWindow())
2068 window->willDetachDocumentFromFrame(); 2068 window->willDetachDocumentFromFrame();
2069 detach(); 2069 destroyRenderTree();
2070 } 2070 }
2071 2071
2072 void Document::removeAllEventListeners() 2072 void Document::removeAllEventListeners()
2073 { 2073 {
2074 EventTarget::removeAllEventListeners(); 2074 EventTarget::removeAllEventListeners();
2075 2075
2076 if (DOMWindow* domWindow = this->domWindow()) 2076 if (DOMWindow* domWindow = this->domWindow())
2077 domWindow->removeAllEventListeners(); 2077 domWindow->removeAllEventListeners();
2078 for (Node* node = firstChild(); node; node = NodeTraversal::next(node)) 2078 for (Node* node = firstChild(); node; node = NodeTraversal::next(node))
2079 node->removeAllEventListeners(); 2079 node->removeAllEventListeners();
(...skipping 3306 matching lines...) Expand 10 before | Expand all | Expand 10 after
5386 { 5386 {
5387 return DocumentLifecycleNotifier::create(this); 5387 return DocumentLifecycleNotifier::create(this);
5388 } 5388 }
5389 5389
5390 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5390 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5391 { 5391 {
5392 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5392 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5393 } 5393 }
5394 5394
5395 } // namespace WebCore 5395 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | Source/core/dom/Node.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698