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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2614663004: Pause HTML parser for external stylesheets in the body (Closed)
Patch Set: Paramaterized test cases 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 264afe19386e3aff07f5d6cae0585fad8c5cca4d..b36d197474c0c08d91e962357ffe0658b4a65ccf 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -161,8 +161,12 @@ void StyleEngine::addPendingSheet(StyleEngineContext& context) {
m_pendingScriptBlockingStylesheets++;
context.addingPendingSheet(document());
- if (context.addedPendingSheetBeforeBody())
+ if (context.addedPendingSheetBeforeBody()) {
m_pendingRenderBlockingStylesheets++;
+ } else {
+ m_pendingBodyStylesheets++;
+ document().didAddPendingStylesheetInBody();
+ }
}
// This method is called whenever a top-level stylesheet has finished loading.
@@ -174,6 +178,11 @@ void StyleEngine::removePendingSheet(Node& styleSheetCandidateNode,
if (context.addedPendingSheetBeforeBody()) {
DCHECK_GT(m_pendingRenderBlockingStylesheets, 0);
m_pendingRenderBlockingStylesheets--;
+ } else {
+ DCHECK_GT(m_pendingBodyStylesheets, 0);
+ m_pendingBodyStylesheets--;
+ if (!m_pendingBodyStylesheets)
+ document().didRemoveAllPendingBodyStylesheets();
}
// Make sure we knew this sheet was pending, and that our count isn't out of
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698