Commit 8dbab3a4 authored by mrowe@apple.com's avatar mrowe@apple.com

2008-02-25 Johnny Ding <johnnyding.webkit@gmail.com>

        Reviewed by Darin Adler.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17444

        In HTMLTokenizer::write, the code checks 'pendingScripts.isEmpty()' to decide
        whether to save prependingSrc or not. However, in HTMLTokenizer::scriptHandler
        and HTMLTokenizer::scriptExecution, 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.

        Test: fast/tokenizer/nested-multiple-scripts.html

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::scriptHandler): check pendingScripts.isEmpty() instead of
        checking state.loadingExtScript().
        (WebCore::HTMLTokenizer::scriptExecution): check pendingScripts.isEmpty() instead of
        checking state.loadingExtScript().

2008-02-25  Johnny Ding  <johnnyding.webkit@gmail.com>

        Reviewed by Darin Adler.

        - bug http://bugs.webkit.org/show_bug.cgi?id=17444
        Test for multiple nested scripts which are in a external script.

        * fast/tokenizer/nested-multiple-scripts-expected.txt: Added.
        * fast/tokenizer/nested-multiple-scripts.html: Added.
        * fast/tokenizer/resources/external-script-1.js: Added.
        * fast/tokenizer/resources/external-script-2.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent be2b2787
2008-02-25 Johnny Ding <johnnyding.webkit@gmail.com>
Reviewed by Darin Adler.
- bug http://bugs.webkit.org/show_bug.cgi?id=17444
Test for multiple nested scripts which are in a external script.
* fast/tokenizer/nested-multiple-scripts-expected.txt: Added.
* fast/tokenizer/nested-multiple-scripts.html: Added.
* fast/tokenizer/resources/external-script-1.js: Added.
* fast/tokenizer/resources/external-script-2.js: Added.
2008-02-24 Michael Knaup <michael.knaup@mac.com>
Reviewed by Darin.
This case is for testing multiple scripts which are nested in external script.
SUCCESS (1 of 2) SUCCESS (2 of 2)
<html>
<body>
This case is for testing multiple scripts which are nested in external script.<br>
<script type="text/javascript" src="resources/external-script-1.js"></script>
</body>
</html>
if (window.layoutTestController)
layoutTestController.dumpAsText();
document.write("<script language=\"javascript\"> function put_content(msg){document.write(msg);} </scr" + "ipt> <script language=\"javascript\" src=\"resources/external-script-2.js\"></scr" + "ipt><script language=\"javascript\">\n");
document.write("put_content(\"SUCCESS (2 of 2)\");");
document.write("</scr"+"ipt>");
2008-02-25 Johnny Ding <johnnyding.webkit@gmail.com>
Reviewed by Darin Adler.
- fix http://bugs.webkit.org/show_bug.cgi?id=17444
In HTMLTokenizer::write, the code checks 'pendingScripts.isEmpty()' to decide
whether to save prependingSrc or not. However, in HTMLTokenizer::scriptHandler
and HTMLTokenizer::scriptExecution, 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.
Test: fast/tokenizer/nested-multiple-scripts.html
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::scriptHandler): check pendingScripts.isEmpty() instead of
checking state.loadingExtScript().
(WebCore::HTMLTokenizer::scriptExecution): check pendingScripts.isEmpty() instead of
checking state.loadingExtScript().
2008-02-24 Darin Adler <darin@apple.com>
* dom/Document.h: Removed stray duplicate declaration of
......@@ -488,7 +488,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
// we need to do this slightly modified bit of one of the write() cases
// because we want to prepend to pendingSrc rather than appending
// if there's no previous prependingSrc
if (state.loadingExtScript()) {
if (!pendingScripts.isEmpty()) {
if (currentPrependingSrc) {
currentPrependingSrc->append(prependingSrc);
} else {
......@@ -547,7 +547,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const String& str, State sta
// we need to do this slightly modified bit of one of the write() cases
// because we want to prepend to pendingSrc rather than appending
// if there's no previous prependingSrc
if (state.loadingExtScript()) {
if (!pendingScripts.isEmpty()) {
if (currentPrependingSrc)
currentPrependingSrc->append(prependingSrc);
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment