Reviewed by Maciej.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2006 20:35:57 +0000 (20:35 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 May 2006 20:35:57 +0000 (20:35 +0000)
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
          Strict mode erroneously triggered by a broken comment

        Test: fast/parser/broken-comments-vs-parsing-mode.html

        * page/Frame.cpp:
        (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.

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

LayoutTests/ChangeLog
LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.checksum [new file with mode: 0644]
LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.png [new file with mode: 0644]
LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.txt [new file with mode: 0644]
LayoutTests/fast/parser/broken-comments-vs-parsing-mode.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/Frame.cpp

index 2b748d1b78f7ae629d11f880e1c36dcf6af9d98c..b91e25c16be6461c96c5993e485d35f42f82e6ff 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-05  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Maciej.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
+          Strict mode erroneously triggered by a broken comment
+
+        * fast/parser/broken-comments-vs-parsing-mode-expected.checksum: Added.
+        * fast/parser/broken-comments-vs-parsing-mode-expected.png: Added.
+        * fast/parser/broken-comments-vs-parsing-mode-expected.txt: Added.
+        * fast/parser/broken-comments-vs-parsing-mode.html: Added.
+
 2006-05-05  Darin Adler  <darin@apple.com>
 
         - test update for http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
diff --git a/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.checksum b/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.checksum
new file mode 100644 (file)
index 0000000..65c7c73
--- /dev/null
@@ -0,0 +1,2 @@
+4906e178fb48b465dcc1bc2ea4a3a008
+\ No newline at end of file
diff --git a/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.png b/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.png
new file mode 100644 (file)
index 0000000..4697a23
Binary files /dev/null and b/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.png differ
diff --git a/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.txt b/LayoutTests/fast/parser/broken-comments-vs-parsing-mode-expected.txt
new file mode 100644 (file)
index 0000000..b2dac57
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x84
+  RenderBlock {HTML} at (0,0) size 800x84
+    RenderBody {BODY} at (8,16) size 784x52
+      RenderBlock {P} at (0,0) size 784x18
+        RenderInline {A} at (0,0) size 60x18 [color=#0000EE]
+          RenderText {#text} at (0,0) size 60x18
+            text run at (0,0) width 60: "bug 8626"
+        RenderText {#text} at (60,0) size 363x18
+          text run at (60,0) width 8: ": "
+          text run at (68,0) width 355: "Strict mode erroneously triggered by a broken comment."
+      RenderBlock {P} at (0,34) size 784x18 [color=#00FF00]
+        RenderText {#text} at (0,0) size 642x18
+          text run at (0,0) width 642: "This text should be green, not black (CSS color values not beginning with '#' are OK in quirks mode)."
diff --git a/LayoutTests/fast/parser/broken-comments-vs-parsing-mode.html b/LayoutTests/fast/parser/broken-comments-vs-parsing-mode.html
new file mode 100644 (file)
index 0000000..45b1b8b
--- /dev/null
@@ -0,0 +1,9 @@
+<html>
+<!-- A broken comment ->
+<body>
+<p><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8626">bug 8626</a>: 
+Strict mode erroneously triggered by a broken comment.</p>
+
+<p style="color:00ff00">This text should be green, not black (CSS color values not beginning with '#' are OK in quirks mode).</p>
+</body>
+</html>
index a043cffa19f9957ce78319a89d70a6bdc378ccd7..6b62324d75c0eb6e0497f53b68ee5c3bfa21cd16 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-05  Alexey Proskuryakov  <ap@nypop.com>
+
+        Reviewed by Maciej.
+
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=8626
+          Strict mode erroneously triggered by a broken comment
+
+        Test: fast/parser/broken-comments-vs-parsing-mode.html
+
+        * page/Frame.cpp:
+        (WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
+
 2006-05-05  Darin Adler  <darin@apple.com>
 
         - fix the Windows build (this time for sure)
index 13a277374198bb3e8b40f3cb8229b97d7b4eb0dd..a110573501a7f29bfa34a8d94d99dd483c24d7c0 100644 (file)
@@ -683,8 +683,14 @@ void Frame::endIfNotLoading()
 
     // make sure nothing's left in there...
     if (d->m_doc) {
-        if (d->m_decoder)
-            write(d->m_decoder->flush());
+        if (d->m_decoder) {
+            DeprecatedString decoded = d->m_decoder->flush();
+            if (d->m_bFirstData) {
+                d->m_doc->determineParseMode(decoded);
+                d->m_bFirstData = false;
+            }
+            write(decoded);
+        }
         d->m_doc->finishParsing();
     } else
         // WebKit partially uses WebCore when loading non-HTML docs.  In these cases doc==nil, but