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

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

Issue 19762002: [HTML Imports] Let script of imported document running. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made a test more robust. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLImportsController.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index c799a6f02e6f315f7318bc9071d4b03f226b8f97..17198513285abc8f24c74e1333901c73b120a80d 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -207,7 +207,9 @@ bool HTMLDocumentParser::processingData() const
void HTMLDocumentParser::pumpTokenizerIfPossible(SynchronousMode mode)
{
- if (isStopped() || isWaitingForScripts())
+ if (isStopped())
+ return;
+ if (isWaitingForScripts())
return;
// Once a resume is scheduled, HTMLParserScheduler controls when we next pump.
@@ -271,7 +273,9 @@ bool HTMLDocumentParser::canTakeNextToken(SynchronousMode mode, PumpSession& ses
// If we're paused waiting for a script, we try to execute scripts before continuing.
runScriptsForPausedTreeBuilder();
- if (isWaitingForScripts() || isStopped())
+ if (isStopped())
+ return false;
+ if (isWaitingForScripts())
return false;
}
@@ -461,7 +465,11 @@ void HTMLDocumentParser::pumpPendingSpeculations()
while (!m_speculations.isEmpty()) {
processParsedChunkFromBackgroundParser(m_speculations.takeFirst());
- if (isWaitingForScripts() || isStopped())
+ // The order matters! If this isStopped(), isWaitingForScripts() can hit and ASSERT since
+ // m_document can be null which is used to decide the readiness.
+ if (isStopped())
+ break;
+ if (isWaitingForScripts())
break;
if (currentTime() - startTime > parserTimeLimit && !m_speculations.isEmpty()) {
« no previous file with comments | « Source/core/html/HTMLImportsController.cpp ('k') | Source/core/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698