Changeset 142200 in webkit
- Timestamp:
- Feb 7, 2013 4:24:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142198 r142200 1 2013-02-07 Adam Barth <abarth@webkit.org> 2 3 fast/parser/document-write-noscript.html fails for threaded HTML parser 4 https://bugs.webkit.org/show_bug.cgi?id=109237 5 6 Reviewed by Eric Seidel. 7 8 This tests basic document.write functionality. There doesn't appear to 9 be another fast/parser test that covers this basic case (although it's 10 convered in some more complicated test cases incidentally.) 11 12 * fast/parser/document-write-basic-expected.txt: Added. 13 * fast/parser/document-write-basic.html: Added. 14 1 15 2013-02-07 Keishi Hattori <keishi@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r142199 r142200 1 2013-02-07 Adam Barth <abarth@webkit.org> 2 3 fast/parser/document-write-noscript.html fails for threaded HTML parser 4 https://bugs.webkit.org/show_bug.cgi?id=109237 5 6 Reviewed by Eric Seidel. 7 8 If there are multiple calls to document.write in an external script, we 9 need to wait for them all to complete before invalidating the 10 speculative tokens. Instead of doing this when we unwind the 11 document.write call stack, we do this when we're about to resume 12 parsing after script execution. 13 14 Test: fast/parser/document-write-basic.html 15 16 * html/parser/HTMLDocumentParser.cpp: 17 (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser): 18 (WebCore::HTMLDocumentParser::insert): 19 (WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution): 20 1 21 2013-02-07 Lamarque V. Souza <Lamarque.Souza@basyskom.com> 2 22 -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
r142099 r142200 288 288 } 289 289 290 void HTMLDocumentParser::checkForSpeculationFailure() 291 { 292 if (!m_tokenizer) 293 return; 294 // FIXME: If the tokenizer is in the same state as when we started this function, 295 // then we haven't necessarily failed our speculation. 296 didFailSpeculation(m_token.release(), m_tokenizer.release()); 297 } 298 290 299 void HTMLDocumentParser::didFailSpeculation(PassOwnPtr<HTMLToken> token, PassOwnPtr<HTMLTokenizer> tokenizer) 291 300 { … … 306 315 RefPtr<HTMLDocumentParser> protect(this); 307 316 308 ASSERT(!m_currentChunk);309 317 m_currentChunk = chunk; 310 318 OwnPtr<CompactHTMLTokenStream> tokens = m_currentChunk->tokens.release(); … … 342 350 } 343 351 344 m_currentChunk.clear(); 352 checkForSpeculationFailure(); 353 345 354 InspectorInstrumentation::didWriteHTML(cookie, lineNumber().zeroBasedInt()); 346 355 } … … 484 493 pumpTokenizerIfPossible(ForceSynchronous); 485 494 486 #if ENABLE(THREADED_HTML_PARSER)487 if (!inPumpSession() && m_haveBackgroundParser) {488 // FIXME: If the tokenizer is in the same state as when we started this function,489 // then we haven't necessarily failed our speculation.490 didFailSpeculation(m_token.release(), m_tokenizer.release());491 return;492 }493 #endif494 495 495 if (isWaitingForScripts()) { 496 496 // Check the document.write() output with a separate preload scanner as … … 715 715 716 716 #if ENABLE(THREADED_HTML_PARSER) 717 if (shouldUseThreading()) { 717 if (m_haveBackgroundParser) { 718 checkForSpeculationFailure(); 719 718 720 while (!m_speculations.isEmpty()) { 719 721 processParsedChunkFromBackgroundParser(m_speculations.takeFirst()); -
trunk/Source/WebCore/html/parser/HTMLDocumentParser.h
r141897 r142200 130 130 void startBackgroundParser(); 131 131 void stopBackgroundParser(); 132 void checkForSpeculationFailure(); 132 133 void didFailSpeculation(PassOwnPtr<HTMLToken>, PassOwnPtr<HTMLTokenizer>); 133 134 void processParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
Note: See TracChangeset
for help on using the changeset viewer.