Fix for 4098281, news.com missing a bunch of content. Make sure not to apply strict...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2005 21:46:40 +0000 (21:46 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2005 21:46:40 +0000 (21:46 +0000)
when stripping comments out of scripts.

New test is comments-in-script.html

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::parseComment):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/fast/parser/comment-in-script-expected.txt [new file with mode: 0644]
LayoutTests/fast/parser/comment-in-script.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/html/htmltokenizer.cpp

diff --git a/LayoutTests/fast/parser/comment-in-script-expected.txt b/LayoutTests/fast/parser/comment-in-script-expected.txt
new file mode 100644 (file)
index 0000000..5063553
--- /dev/null
@@ -0,0 +1,6 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x316
+  RenderBlock {HTML} at (0,0) size 800x316
+    RenderBody {BODY} at (8,8) size 784x300
+      RenderImage {IMG} at (0,0) size 300x300 [bgcolor=#008000]
diff --git a/LayoutTests/fast/parser/comment-in-script.html b/LayoutTests/fast/parser/comment-in-script.html
new file mode 100644 (file)
index 0000000..ce5b332
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<script><!--
+    var x="--"
+    //--></script>
+<img style="width:300px;height:300px; background-color:green"  alt="--">
index 39298f9615225a4ba72324480a5acd2827e203ea..b719d1c1dad6d71f8ed6a87fec79854e98b8dbe1 100644 (file)
@@ -1,3 +1,13 @@
+2005-05-03  David Hyatt  <hyatt@apple.com>
+
+       Fix for 4098281, news.com missing a bunch of content.  Make sure not to apply strict SGML parsing
+       when stripping comments out of scripts.
+
+       New test is comments-in-script.html
+       
+        * khtml/html/htmltokenizer.cpp:
+        (khtml::HTMLTokenizer::parseComment):
+
 2005-05-03  David Hyatt  <hyatt@apple.com>
 
        Remove unused notification to avoid ERROR messages spewing on the acid2 test.
index 8532affb6b173b270723cec30ff6db70c4c1e938..746992e8711f2f9119029d8b23d8ca74238fcd0d 100644 (file)
@@ -657,7 +657,8 @@ void HTMLTokenizer::scriptExecution( const QString& str, QString scriptURL,
 
 void HTMLTokenizer::parseComment(TokenizerString &src)
 {
-    bool strict = !parser->doc()->inCompatMode();
+    // FIXME: Why does this code even run for comments inside <script>? This seems bogus.
+    bool strict = !parser->doc()->inCompatMode() && !script;
     int delimiterCount = 0;
     bool canClose = false;
     checkScriptBuffer(src.length());