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

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

Issue 2614663004: Pause HTML parser for external stylesheets in the body (Closed)
Patch Set: merge to trunk Created 3 years, 11 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 updateActiveStyle(); 156 updateActiveStyle();
157 return *m_inspectorStyleSheet; 157 return *m_inspectorStyleSheet;
158 } 158 }
159 159
160 void StyleEngine::addPendingSheet(StyleEngineContext& context) { 160 void StyleEngine::addPendingSheet(StyleEngineContext& context) {
161 m_pendingScriptBlockingStylesheets++; 161 m_pendingScriptBlockingStylesheets++;
162 162
163 context.addingPendingSheet(document()); 163 context.addingPendingSheet(document());
164 if (context.addedPendingSheetBeforeBody()) 164 if (context.addedPendingSheetBeforeBody())
165 m_pendingRenderBlockingStylesheets++; 165 m_pendingRenderBlockingStylesheets++;
166 else
167 document().didAddPendingStylesheetInBody();
166 } 168 }
167 169
168 // This method is called whenever a top-level stylesheet has finished loading. 170 // This method is called whenever a top-level stylesheet has finished loading.
169 void StyleEngine::removePendingSheet(Node& styleSheetCandidateNode, 171 void StyleEngine::removePendingSheet(Node& styleSheetCandidateNode,
170 const StyleEngineContext& context) { 172 const StyleEngineContext& context) {
171 if (styleSheetCandidateNode.isConnected()) 173 if (styleSheetCandidateNode.isConnected())
172 setNeedsActiveStyleUpdate(styleSheetCandidateNode.treeScope()); 174 setNeedsActiveStyleUpdate(styleSheetCandidateNode.treeScope());
173 175
174 if (context.addedPendingSheetBeforeBody()) { 176 if (context.addedPendingSheetBeforeBody()) {
175 DCHECK_GT(m_pendingRenderBlockingStylesheets, 0); 177 DCHECK_GT(m_pendingRenderBlockingStylesheets, 0);
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 } 1137 }
1136 1138
1137 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1139 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1138 for (auto sheet : m_injectedAuthorStyleSheets) { 1140 for (auto sheet : m_injectedAuthorStyleSheets) {
1139 visitor->traceWrappers(sheet); 1141 visitor->traceWrappers(sheet);
1140 } 1142 }
1141 visitor->traceWrappers(m_documentStyleSheetCollection); 1143 visitor->traceWrappers(m_documentStyleSheetCollection);
1142 } 1144 }
1143 1145
1144 } // namespace blink 1146 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698