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

Unified Diff: Source/core/html/parser/HTMLDocumentParser.cpp

Issue 26129005: Rewrite Text node attaching to not be N^2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Flush for foriegn content also Created 7 years, 1 month 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/html/parser/HTMLConstructionSite.cpp ('k') | Source/core/html/parser/HTMLTreeBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLDocumentParser.cpp
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index e0dfa89524655f0744cc7d8863a4958c941c38a3..f3a7f49f75121a265fcd27f833d2356e1963e752 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -557,6 +557,12 @@ void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
if (isStopped())
return;
+ // There should only be PendingText left since the tree-builder always flushes
+ // the task queue before returning. In case that ever changes, crash.
+ if (mode == ForceSynchronous)
+ m_treeBuilder->flush();
+ RELEASE_ASSERT(!isStopped());
+
if (session.needsYield)
m_parserScheduler->scheduleForResume();
« no previous file with comments | « Source/core/html/parser/HTMLConstructionSite.cpp ('k') | Source/core/html/parser/HTMLTreeBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698