Index: Source/core/html/parser/HTMLDocumentParser.cpp |
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp |
index cf2aed090d9cbbb4d40c836eab576e588d10d507..685c097b8cf1fb27461a4d1928709f01009f1a6e 100644 |
--- a/Source/core/html/parser/HTMLDocumentParser.cpp |
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp |
@@ -43,6 +43,7 @@ |
#include "core/loader/DocumentLoader.h" |
#include "platform/SharedBuffer.h" |
#include "platform/TraceEvent.h" |
+#include "platform/scheduler/Scheduler.h" |
#include "public/platform/WebThreadedDataReceiver.h" |
#include "wtf/Functional.h" |
@@ -536,7 +537,7 @@ void HTMLDocumentParser::pumpPendingSpeculations() |
if (isStopped() || isWaitingForScripts()) |
break; |
- if (currentTime() - startTime > parserTimeLimit && !m_speculations.isEmpty()) { |
+ if ((Scheduler::shared()->shouldYieldForHighPriorityWork() || currentTime() - startTime > parserTimeLimit) && !m_speculations.isEmpty()) { |
m_parserScheduler->scheduleForResume(); |
break; |
} |