| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index f2929f0eb0859debabec50951d240a1dfae0d4b2..1d66fb41ce8cea65e207d5d0f3e36091ad434676 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -336,6 +336,8 @@ static bool acceptsEditingFocus(const Element& element)
|
|
|
| uint64_t Document::s_globalTreeVersion = 0;
|
|
|
| +static bool s_threadedParsingEnabledForUnitTests = true;
|
| +
|
| Document::WeakDocumentSet& Document::liveDocumentSet()
|
| {
|
| DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrWillBeNoop(new WeakDocumentSet())));
|
| @@ -2381,6 +2383,9 @@ PassRefPtrWillBeRawPtr<DocumentParser> Document::implicitOpen(ParserSynchronizat
|
|
|
| setCompatibilityMode(NoQuirksMode);
|
|
|
| + if (!threadedParsingEnabledForUnitTestsOnly())
|
| + parserSyncPolicy = ForceSynchronousParsing;
|
| +
|
| m_parserSyncPolicy = parserSyncPolicy;
|
| m_parser = createParser();
|
| setParsingState(Parsing);
|
| @@ -5226,6 +5231,16 @@ void Document::adjustFloatRectForScrollAndAbsoluteZoom(FloatRect& rect, LayoutOb
|
| adjustFloatRectForAbsoluteZoom(rect, layoutObject);
|
| }
|
|
|
| +void Document::setThreadedParsingEnabledForUnitTestsOnly(bool enabled)
|
| +{
|
| + s_threadedParsingEnabledForUnitTests = enabled;
|
| +}
|
| +
|
| +bool Document::threadedParsingEnabledForUnitTestsOnly()
|
| +{
|
| + return s_threadedParsingEnabledForUnitTests;
|
| +}
|
| +
|
| bool Document::hasActiveParser()
|
| {
|
| return m_activeParserCount || (m_parser && m_parser->processingData());
|
|
|