12010-06-02 Eric Seidel <eric@webkit.org>
2
3 Reviewed by NOBODY (OOPS!).
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