LayoutTests/ChangeLog

 12010-06-21 Adam Barth <abarth@webkit.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 document.write from BeforeLoad should not assert
 6 https://bugs.webkit.org/show_bug.cgi?id=40971
 7
 8 Test what happens when we document.write from a beforeload event.
 9 Notice that the order is wrong. I'll fix that in a followup patch.
 10
 11 * fast/tokenizer/write-before-load-expected.txt: Added.
 12 * fast/tokenizer/write-before-load.html: Added.
 13
1142010-06-21 Dmitry Titov <dimich@chromium.org>
215
316 Unreviewed, fixing qt-specific expected results for r61599

LayoutTests/fast/tokenizer/write-before-load-expected.txt

 11 2 7 3456

LayoutTests/fast/tokenizer/write-before-load.html

 11
 2<script>
 3if (window.layoutTestController)
 4 layoutTestController.dumpAsText();
 5
 6function doubleWrite(number)
 7{
 8 document.write("<script>document.write(" + number + ")</scr" +
 9 "ipt><script>document.write(" + (number + 1) + ")</scr" + "ipt>")
 10}
 11</script>
 122
 13<script
 14 onbeforeload="doubleWrite(3)"
 15 src="data:text/javascript,doubleWrite(5)">
 16</script>
 177

WebCore/ChangeLog

 12010-06-21 Adam Barth <abarth@webkit.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 document.write from BeforeLoad should not assert
 6 https://bugs.webkit.org/show_bug.cgi?id=40971
 7
 8 We're setting the parse blocking script too early. It's not actually
 9 blocking parsing yet.
 10
 11 Test: fast/tokenizer/write-before-load.html
 12
 13 * html/HTML5ScriptRunner.cpp:
 14 (WebCore::HTML5ScriptRunner::requestScript):
 15
1162010-06-21 Chris Fleizach <cfleizach@apple.com>
217
318 No review. QT build fix again.

WebCore/html/HTML5ScriptRunner.cpp

@@void HTML5ScriptRunner::requestScript(Element* script)
234234 return;
235235
236236 // FIXME: We need to resolve the url relative to the element.
237  m_parsingBlockingScript.element = script;
238237 if (!script->dispatchBeforeLoadEvent(srcValue)) // Part of HTML5?
239238 return;
 239 m_parsingBlockingScript.element = script;
240240 // This should correctly return 0 for empty or invalid srcValues.
241241 CachedScript* cachedScript = m_document->docLoader()->requestScript(srcValue, toScriptElement(script)->scriptCharset());
242242 if (!cachedScript) {