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

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

Issue 17640007: Refactoring: Simplify DocumentWriter by reorganizing its lifetime. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-landing after fixing ASAN failure on set-parent-src-synchronously.xhtml. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/RawDataDocumentParser.h » ('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 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2145 return; 2145 return;
2146 2146
2147 // We have to clear the parser to avoid possibly triggering 2147 // We have to clear the parser to avoid possibly triggering
2148 // the onload handler when closing as a side effect of a cancel-style 2148 // the onload handler when closing as a side effect of a cancel-style
2149 // change, such as opening a new document or closing the window while 2149 // change, such as opening a new document or closing the window while
2150 // still parsing 2150 // still parsing
2151 detachParser(); 2151 detachParser();
2152 explicitClose(); 2152 explicitClose();
2153 } 2153 }
2154 2154
2155 void Document::implicitOpen() 2155 PassRefPtr<DocumentParser> Document::implicitOpen()
2156 { 2156 {
2157 cancelParsing(); 2157 cancelParsing();
2158 2158
2159 removeChildren(); 2159 removeChildren();
2160 ASSERT(!m_focusedNode); 2160 ASSERT(!m_focusedNode);
2161 2161
2162 setCompatibilityMode(NoQuirksMode); 2162 setCompatibilityMode(NoQuirksMode);
2163 2163
2164 // Documents rendered seamlessly should start out requiring a stylesheet 2164 // Documents rendered seamlessly should start out requiring a stylesheet
2165 // collection update in order to ensure they inherit all the relevant data 2165 // collection update in order to ensure they inherit all the relevant data
2166 // from their parent. 2166 // from their parent.
2167 if (shouldDisplaySeamlesslyWithParent()) 2167 if (shouldDisplaySeamlesslyWithParent())
2168 styleResolverChanged(DeferRecalcStyle); 2168 styleResolverChanged(DeferRecalcStyle);
2169 2169
2170 m_parser = createParser(); 2170 m_parser = createParser();
2171 setParsing(true); 2171 setParsing(true);
2172 setReadyState(Loading); 2172 setReadyState(Loading);
2173
2174 return m_parser;
2173 } 2175 }
2174 2176
2175 HTMLElement* Document::body() const 2177 HTMLElement* Document::body() const
2176 { 2178 {
2177 Node* de = documentElement(); 2179 Node* de = documentElement();
2178 if (!de) 2180 if (!de)
2179 return 0; 2181 return 0;
2180 2182
2181 // try to prefer a FRAMESET element over BODY 2183 // try to prefer a FRAMESET element over BODY
2182 Node* body = 0; 2184 Node* body = 0;
(...skipping 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after
5221 { 5223 {
5222 return DocumentLifecycleNotifier::create(this); 5224 return DocumentLifecycleNotifier::create(this);
5223 } 5225 }
5224 5226
5225 DocumentLifecycleNotifier* Document::lifecycleNotifier() 5227 DocumentLifecycleNotifier* Document::lifecycleNotifier()
5226 { 5228 {
5227 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier()); 5229 return static_cast<DocumentLifecycleNotifier*>(ScriptExecutionContext::lifec ycleNotifier());
5228 } 5230 }
5229 5231
5230 } // namespace WebCore 5232 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/RawDataDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698