summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrowe@apple.com <mrowe@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2008-02-25 13:14:27 +0000
committermrowe@apple.com <mrowe@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2008-02-25 13:14:27 +0000
commit6c14fdf15198b6149a636e59f23487da816b0dde (patch)
treeab652133242f5da43bc585adcfc525e34a150fa7
parent10ed65eb5f982acbb46b1368777a95bfa62b3360 (diff)
downloadchromium_src-6c14fdf15198b6149a636e59f23487da816b0dde.zip
chromium_src-6c14fdf15198b6149a636e59f23487da816b0dde.tar.gz
chromium_src-6c14fdf15198b6149a636e59f23487da816b0dde.tar.bz2
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: svn://svn.chromium.org/blink/trunk@30563 bbb929c8-8fbe-4397-9dbb-9b2b20218538
-rw-r--r--third_party/WebKit/LayoutTests/ChangeLog12
-rw-r--r--third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts-expected.txt2
-rw-r--r--third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts.html6
-rw-r--r--third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-1.js6
-rw-r--r--third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-2.js2
-rw-r--r--third_party/WebKit/WebCore/ChangeLog21
-rw-r--r--third_party/WebKit/WebCore/html/HTMLTokenizer.cpp4
7 files changed, 51 insertions, 2 deletions
diff --git a/third_party/WebKit/LayoutTests/ChangeLog b/third_party/WebKit/LayoutTests/ChangeLog
index 0f5528d..45c3c5a 100644
--- a/third_party/WebKit/LayoutTests/ChangeLog
+++ b/third_party/WebKit/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+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.
diff --git a/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts-expected.txt b/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts-expected.txt
new file mode 100644
index 0000000..e7aa9c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts-expected.txt
@@ -0,0 +1,2 @@
+This case is for testing multiple scripts which are nested in external script.
+SUCCESS (1 of 2) SUCCESS (2 of 2)
diff --git a/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts.html b/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts.html
new file mode 100644
index 0000000..d62ac96
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/tokenizer/nested-multiple-scripts.html
@@ -0,0 +1,6 @@
+<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>
diff --git a/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-1.js b/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-1.js
new file mode 100644
index 0000000..e97ee9b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-1.js
@@ -0,0 +1,6 @@
+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>");
+
diff --git a/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-2.js b/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-2.js
new file mode 100644
index 0000000..c0ab414
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/tokenizer/resources/external-script-2.js
@@ -0,0 +1,2 @@
+document.write("SUCCESS (1 of 2)\n");
+
diff --git a/third_party/WebKit/WebCore/ChangeLog b/third_party/WebKit/WebCore/ChangeLog
index 2708101..9820089 100644
--- a/third_party/WebKit/WebCore/ChangeLog
+++ b/third_party/WebKit/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+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
diff --git a/third_party/WebKit/WebCore/html/HTMLTokenizer.cpp b/third_party/WebKit/WebCore/html/HTMLTokenizer.cpp
index 1a25da1..ee2d4bf 100644
--- a/third_party/WebKit/WebCore/html/HTMLTokenizer.cpp
+++ b/third_party/WebKit/WebCore/html/HTMLTokenizer.cpp
@@ -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