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

Unified Diff: Source/core/dom/Document.cpp

Issue 1313013005: Add a test that we resume commits after inserting the body. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: dcheng@ review Created 5 years, 4 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/dom/Document.h ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698