Reviewed by Maciej.
- follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
* khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
scripts being loaded here. If the current code being run is the external script itself, then we don't want
to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
wrong since there can be a script loading in that case too. Layout tests check for both problems.
* layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
* layout-tests/fast/tokenizer/external-script-document-write.html: Added.
* layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
* layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7857
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x34
+ RenderBlock {HTML} at (0,0) size 800x34
+ RenderBody {BODY} at (8,8) size 784x18
+ RenderInline {SPAN} at (0,0) size 0x0
+ RenderText {TEXT} at (0,0) size 226x18
+ text run at (0,0) width 226: "This should be a span: [object span]"
--- /dev/null
+<script src="resources/external-script-document-write.js" type="text/javascript"></script>
--- /dev/null
+document.write('<span id="x"></span>');
+document.write("This should be a span: " + document.getElementById('x'));
+ 2004-10-19 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - follow-on to my fix yesterday, which broke a layout test because I rolled out a fix that Maciej had done
+
+ * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::write): Need to check the actual queue of external
+ scripts being loaded here. If the current code being run is the external script itself, then we don't want
+ to defer parsing. But loadingExtScript has to stay true until after the script runs. The old code would
+ assume that any time we're running a script there's no need to look at loadingExtScript, but that was also
+ wrong since there can be a script loading in that case too. Layout tests check for both problems.
+
+ * layout-tests/fast/tokenizer/external-script-document-write-expected.txt: Added.
+ * layout-tests/fast/tokenizer/external-script-document-write.html: Added.
+ * layout-tests/fast/tokenizer/resources/external-script-document-write.js: Added.
+
+ * layout-tests/fast/tokenizer/004.html: Fixed line endings (were CR, should be LF).
+
2004-10-18 Darin Adler <darin@apple.com>
Reviewed by Dave Hyatt.
if ( !buffer )
return;
- if ( ( m_executingScript && appendData ) || ( !m_executingScript && loadingExtScript ) ) {
+ if ( ( m_executingScript && appendData ) || !cachedScript.isEmpty() ) {
// don't parse; we will do this later
if (currentPrependingSrc) {
currentPrependingSrc->append(str);