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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp

Issue 2540653002: Revert of Script blocking resources tracking should be only done by Document::isScriptExecutionReady (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
index 0f3b3f7612ee27f0d72d0d18f6e233807a888608..55c5ccd9fe0ea4fd6293e40e1b5a3c4f9f98d14d 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -398,10 +398,6 @@
void HTMLDocumentParser::validateSpeculations(
std::unique_ptr<TokenizedChunk> chunk) {
ASSERT(chunk);
- // TODO(kouhei): We should simplify codepath here by disallowing
- // validateSpeculations
- // while isWaitingForScripts, and m_lastChunkBeforeScript can simply be
- // pushed to m_speculations.
if (isWaitingForScripts()) {
// We're waiting on a network script, just save the chunk, we'll get a
// second validateSpeculations call after the script completes. This call
@@ -1065,11 +1061,9 @@
ASSERT(!isWaitingForScripts());
if (m_haveBackgroundParser) {
- if (m_lastChunkBeforeScript) {
- validateSpeculations(std::move(m_lastChunkBeforeScript));
- DCHECK(!m_lastChunkBeforeScript);
- pumpPendingSpeculations();
- }
+ validateSpeculations(std::move(m_lastChunkBeforeScript));
+ ASSERT(!m_lastChunkBeforeScript);
+ pumpPendingSpeculations();
return;
}
@@ -1104,11 +1098,14 @@
}
void HTMLDocumentParser::executeScriptsWaitingForResources() {
- DCHECK(document()->isScriptExecutionReady());
-
// Document only calls this when the Document owns the DocumentParser so this
// will not be called in the DocumentFragment case.
- DCHECK(m_scriptRunner);
+ ASSERT(m_scriptRunner);
+ // Ignore calls unless we have a script blocking the parser waiting on a
+ // stylesheet load. Otherwise we are currently parsing and this is a
+ // re-entrant call from encountering a </ style> tag.
+ if (!m_scriptRunner->hasScriptsWaitingForResources())
+ return;
m_scriptRunner->executeScriptsWaitingForResources();
if (!isWaitingForScripts())
resumeParsingAfterScriptExecution();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698