Index: Source/core/html/parser/HTMLParserScheduler.cpp |
diff --git a/Source/core/html/parser/HTMLParserScheduler.cpp b/Source/core/html/parser/HTMLParserScheduler.cpp |
index 1dbd927ff2b20907753ec165cb0c32432e23d201..d99589ade868e06e75455b5668c2cf2f2d8a6b32 100644 |
--- a/Source/core/html/parser/HTMLParserScheduler.cpp |
+++ b/Source/core/html/parser/HTMLParserScheduler.cpp |
@@ -90,7 +90,9 @@ void HTMLParserScheduler::continueNextChunkTimerFired(Timer<HTMLParserScheduler> |
ASSERT_UNUSED(timer, timer == &m_continueNextChunkTimer); |
// FIXME: The timer class should handle timer priorities instead of this code. |
// If a layout is scheduled, wait again to let the layout timer run first. |
- if (m_parser->document()->isLayoutTimerActive()) { |
+ // FIXME: We should fix this by reducing the max-parse-time instead of |
+ // artificially forcing the parser to yield agressively before first layout. |
+ if (m_parser->document()->parserShouldYieldAgressivelyBeforeFirstLayout()) { |
m_continueNextChunkTimer.startOneShot(0); |
return; |
} |
@@ -103,7 +105,7 @@ void HTMLParserScheduler::checkForYieldBeforeScript(PumpSession& session) |
// scripts to give the page a chance to paint earlier. |
Document* document = m_parser->document(); |
bool needsFirstPaint = document->view() && !document->view()->hasEverPainted(); |
- if (needsFirstPaint && document->isLayoutTimerActive()) |
+ if (needsFirstPaint && document->parserShouldYieldAgressivelyBeforeFirstLayout()) |
session.needsYield = true; |
session.didSeeScript = true; |
} |