Changeset 60606 in webkit
- Timestamp:
- Jun 2, 2010 10:25:14 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r60605 r60606 1 2010-06-02 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 REGRESSION(60409): document.write is not synchronous when using the HTML5 parser 6 https://bugs.webkit.org/show_bug.cgi?id=40047 7 8 The HTML5 spec states that we should "spin the event loop" while 9 waiting for stylesheets to load. Currently we do that by yielding 10 out of the parser when stylesheets are loading. Because it was easy 11 we made inline <scripts> yield for stylesheet loads as well. However, 12 this caused document.write() to return after encountering the first 13 inline <script> tag in many cases which is incorrect. document.write 14 is supposed to block until the entire document is parsed (including) 15 executing inline script tags. To match the exiting parser, we'll just 16 make inline <script> tags not block on stylesheets for now. 17 18 This is tested by WebCore/benchmarks/html-parser.html as well 19 as likely several other tests in LayoutTests which we haven't 20 triaged yet. 21 22 * html/HTML5ScriptRunner.cpp: 23 (WebCore::HTML5ScriptRunner::executeScript): 24 - ASSERT that either stylesheets have loaded or we're executing an 25 inline <script> tag. 26 (WebCore::HTML5ScriptRunner::runScript): 27 - Remove the code to block inline <script> tags on stylesheet loads. 28 1 29 2010-06-02 MORITA Hajime <morrita@google.com> 2 30 -
trunk/WebCore/html/HTML5ScriptRunner.cpp
r60553 r60606 128 128 void HTML5ScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode) 129 129 { 130 // FIXME: We do not block inline <script> tags on stylesheets for now. 131 // When we do, || !element->hasAttribute(srcAttr) should be removed from 132 // the ASSERT below. See https://bugs.webkit.org/show_bug.cgi?id=40047 133 ASSERT(m_document->haveStylesheetsLoaded() || !element->hasAttribute(srcAttr)); 130 134 ScriptElement* scriptElement = toScriptElement(element); 131 135 ASSERT(scriptElement); … … 235 239 // FIXME: Handle defer and async 236 240 requestScript(script); 237 } else if (!m_document->haveStylesheetsLoaded()) {238 m_parsingBlockingScript.element = script;239 m_parsingBlockingScript.startingLineNumber = startingLineNumber;240 241 } else { 242 // FIXME: We do not block inline <script> tags on stylesheets to match the 243 // old parser for now. See https://bugs.webkit.org/show_bug.cgi?id=40047 241 244 ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), startingLineNumber); 242 245 executeScript(script, sourceCode);
Note: See TracChangeset
for help on using the changeset viewer.