RESOLVED FIXED 17444
nested script inside external script cause error
https://bugs.webkit.org/show_bug.cgi?id=17444
Summary nested script inside external script cause error
johnnyding
Reported 2008-02-20 02:06:25 PST
nest script which is inside external script will cause error. Please see attached test cases.
Attachments
html file for this test case (466 bytes, text/html)
2008-02-20 02:07 PST, johnnyding
no flags
script file for this test case (238 bytes, text/html)
2008-02-20 02:08 PST, johnnyding
no flags
patch v1 for fixing this problem (5.21 KB, patch)
2008-02-20 06:26 PST, johnnyding
darin: review+
it's basically same patch as patch v1, only change the wording in test case according to darin's comment (5.12 KB, patch)
2008-02-24 22:44 PST, johnnyding
darin: review+
johnnyding
Comment 1 2008-02-20 02:07:53 PST
Created attachment 19222 [details] html file for this test case
johnnyding
Comment 2 2008-02-20 02:08:26 PST
Created attachment 19223 [details] script file for this test case
johnnyding
Comment 3 2008-02-20 02:40:39 PST
Download both html file and script file to your local file system. The expected behavior is to display 'external_script_1', but 'put_content("external_script_1")" is displayed instead. This is because, in HTMLTokenizer::write(HTMLTokenizer.cpp line:1345), the code checks 'pendingScripts.isEmpty()' to decide whether to save prependingSrc or not. However, in HTMLTokenizer::scriptHandler(HTMLTokenizer.cpp line:485) and HTMLTokenizer::scriptExecution(HTMLTokenizer.cpp line:544), the code checks testBit:LoadingExtScript to decide whether to save prependingSrc or not. The later behavior is not right because, in scriptHandler and scriptExecution, even the pendingScripts queue is empty, the testBit:LoadingExtScript might be TRUE, (it may not be updated until the end of the function). A patch is coming soon.
johnnyding
Comment 4 2008-02-20 06:26:15 PST
Created attachment 19226 [details] patch v1 for fixing this problem
johnnyding
Comment 5 2008-02-21 17:31:00 PST
This bug block some Chinese websites which have high traffic such as www.chinacars.com. Could anyone help me take a look this problem?
Darin Adler
Comment 6 2008-02-24 18:07:26 PST
Comment on attachment 19226 [details] patch v1 for fixing this problem Looks good to me. + <head> + <title></title> + </head> Seems like we could just omit this whole section. + </div> There's no <div> for this to close. +document.write("SUCCESS (1 of 2)\n"); \ No newline at end of file Would have been better having a newline at the end of this file. r=me even without these changes
johnnyding
Comment 7 2008-02-24 22:44:27 PST
Created attachment 19340 [details] it's basically same patch as patch v1, only change the wording in test case according to darin's comment
Mark Rowe (bdash)
Comment 8 2008-02-25 05:14:50 PST
Landed in r30563.
Yael
Comment 9 2008-07-01 06:27:26 PDT
*** Bug 19680 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.