| Index: Source/core/html/parser/HTMLDocumentParser.cpp
|
| diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
|
| index 494e626632747c47732fd85919edf1c039b0c49f..42afc34feadad9a77fce0a28becff2709a8bc364 100644
|
| --- a/Source/core/html/parser/HTMLDocumentParser.cpp
|
| +++ b/Source/core/html/parser/HTMLDocumentParser.cpp
|
| @@ -530,6 +530,10 @@ void HTMLDocumentParser::pumpPendingSpeculations()
|
| SpeculationsPumpSession session(m_pumpSpeculationsSessionNestingLevel, contextForParsingSession());
|
| while (!m_speculations.isEmpty()) {
|
| ASSERT(!isScheduledForResume());
|
| +
|
| + if (m_parserScheduler->yieldIfNeeded(session, m_speculations.first()->startingScript))
|
| + break;
|
| +
|
| size_t elementTokenCount = processParsedChunkFromBackgroundParser(m_speculations.takeFirst());
|
| session.addedElementTokens(elementTokenCount);
|
|
|
| @@ -539,9 +543,6 @@ void HTMLDocumentParser::pumpPendingSpeculations()
|
| // which invokes nested event loops. (e.g. inspector breakpoints)
|
| if (!isParsing() || isWaitingForScripts() || isScheduledForResume())
|
| break;
|
| -
|
| - if (m_speculations.isEmpty() || m_parserScheduler->yieldIfNeeded(session, m_speculations.first()->startingScript))
|
| - break;
|
| }
|
|
|
| TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ParseHTML", "endLine", lineNumber().zeroBasedInt());
|
|
|