Title: [140484] trunk/Source/WebCore
Revision
140484
Author
to...@chromium.org
Date
2013-01-22 16:03:01 -0800 (Tue, 22 Jan 2013)

Log Message

Fix ASSERT(!hasInsertionPoint()) in threaded HTML parser
https://bugs.webkit.org/show_bug.cgi?id=107593

Reviewed by Adam Barth.

Prior to this patch, several fast/parser tests hit ASSERT(!hasInsertionPoint()) in prepareToStopParsing().
That was because hasInsertionPoint() checks m_input.haveSeenEndOfFile() which was skipped for the threaded
parser case. This patch causes us to call markEndOfFile().

No new tests because covered by existing fast/parser tests.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didReceiveTokensFromBackgroundParser): This FIXME was done in a previous patch.
(WebCore::HTMLDocumentParser::finish):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140483 => 140484)


--- trunk/Source/WebCore/ChangeLog	2013-01-22 23:45:45 UTC (rev 140483)
+++ trunk/Source/WebCore/ChangeLog	2013-01-23 00:03:01 UTC (rev 140484)
@@ -1,3 +1,20 @@
+2013-01-22  Tony Gentilcore  <to...@chromium.org>
+
+        Fix ASSERT(!hasInsertionPoint()) in threaded HTML parser
+        https://bugs.webkit.org/show_bug.cgi?id=107593
+
+        Reviewed by Adam Barth.
+
+        Prior to this patch, several fast/parser tests hit ASSERT(!hasInsertionPoint()) in prepareToStopParsing().
+        That was because hasInsertionPoint() checks m_input.haveSeenEndOfFile() which was skipped for the threaded
+        parser case. This patch causes us to call markEndOfFile().
+
+        No new tests because covered by existing fast/parser tests.
+
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::didReceiveTokensFromBackgroundParser): This FIXME was done in a previous patch.
+        (WebCore::HTMLDocumentParser::finish):
+
 2013-01-22  Joshua Bell  <jsb...@chromium.org>
 
         Prevent race condition during Worker shutdown

Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (140483 => 140484)


--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-01-22 23:45:45 UTC (rev 140483)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp	2013-01-23 00:03:01 UTC (rev 140484)
@@ -301,10 +301,6 @@
             return;
         }
 
-        // FIXME: This is too abrupt a way to end parsing because we might
-        // have to wait for deferred scripts. We probably want to call
-        // attemptToRunDeferredScriptsAndEnd(), prepareToStopParsing(), or
-        // attemptToEnd() instead.
         if (it->type() == HTMLTokenTypes::EndOfFile) {
             ASSERT(it + 1 == tokens->end()); // The EOF is assumed to be the last token of this bunch.
             prepareToStopParsing();
@@ -576,6 +572,16 @@
 
 void HTMLDocumentParser::finish()
 {
+    // FIXME: We should ASSERT(!m_parserStopped) here, since it does not
+    // makes sense to call any methods on DocumentParser once it's been stopped.
+    // However, FrameLoader::stop calls DocumentParser::finish unconditionally.
+
+    // We're not going to get any more data off the network, so we tell the
+    // input stream we've reached the end of file. finish() can be called more
+    // than once, if the first time does not call end().
+    if (!m_input.haveSeenEndOfFile())
+        m_input.markEndOfFile();
+
 #if ENABLE(THREADED_HTML_PARSER)
     // Empty documents never got an append() call, and thus have never started
     // a background parser. In those cases, we ignore shouldUseThreading()
@@ -586,15 +592,6 @@
     }
 #endif
 
-    // FIXME: We should ASSERT(!m_parserStopped) here, since it does not
-    // makes sense to call any methods on DocumentParser once it's been stopped.
-    // However, FrameLoader::stop calls DocumentParser::finish unconditionally.
-
-    // We're not going to get any more data off the network, so we tell the
-    // input stream we've reached the end of file.  finish() can be called more
-    // than once, if the first time does not call end().
-    if (!m_input.haveSeenEndOfFile())
-        m_input.markEndOfFile();
     attemptToEnd();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to