WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2008 07:38:13 +0000 (07:38 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2008 07:38:13 +0000 (07:38 +0000)
        Reviewed by Dave Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17465
          REGRESSION: <DIV> tokenized into Div if still searching for DOCTYPE

        Test: fast/tokenizer/doctype-search-reset.html

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::parseTag):

LayoutTests:

        Reviewed by Dave Hyatt.

        - test for http://bugs.webkit.org/show_bug.cgi?id=17465
          REGRESSION: <DIV> tokenized into Div if still searching for DOCTYPE

        * fast/tokenizer/doctype-search-reset-expected.txt: Added.
        * fast/tokenizer/doctype-search-reset.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/tokenizer/doctype-search-reset-expected.txt [new file with mode: 0644]
LayoutTests/fast/tokenizer/doctype-search-reset.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLTokenizer.cpp

index 4994781d5ac00af619ef565024b5d7ac7e9e10cb..361450741ec198b3de1c798a419865bac5ebb930 100644 (file)
@@ -1,3 +1,13 @@
+2008-02-20  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=17465
+          REGRESSION: <DIV> tokenized into Div if still searching for DOCTYPE
+
+        * fast/tokenizer/doctype-search-reset-expected.txt: Added.
+        * fast/tokenizer/doctype-search-reset.html: Added.
+
 2008-02-20  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/tokenizer/doctype-search-reset-expected.txt b/LayoutTests/fast/tokenizer/doctype-search-reset-expected.txt
new file mode 100644 (file)
index 0000000..7ef22e9
--- /dev/null
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/tokenizer/doctype-search-reset.html b/LayoutTests/fast/tokenizer/doctype-search-reset.html
new file mode 100644 (file)
index 0000000..1c9b389
--- /dev/null
@@ -0,0 +1,12 @@
+<!-- comment --><DIV id="target"></DIV>
+<span id="result">Test did not run</span>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+    var target = document.getElementById("target");
+    var result = document.getElementById("result");
+    if (HTMLDivElement.prototype.isPrototypeOf(target))
+        result.innerText = "PASS";
+    else
+        result.innerText = "FAIL";
+</script>
index ccbcc37a128f6d09e3bc87bdd4bdea9b6c0c1c06..d80f26f0e0acdf9dbd400a91e06ae438dd1bca92 100644 (file)
@@ -1,3 +1,15 @@
+2008-02-20  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=17465
+          REGRESSION: <DIV> tokenized into Div if still searching for DOCTYPE
+
+        Test: fast/tokenizer/doctype-search-reset.html
+
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::parseTag):
+
 2008-02-20  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
index 88ec6de420b11b3f31880d1134a79bf2ac893fd7..5101cce32ee43dd10282bdede9eb201ad17601a5 100644 (file)
@@ -1089,6 +1089,8 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
                     searchCount++;
                     if (searchCount == 2)
                         m_doctypeSearchCount++; // A '!' is also part of a doctype, so we are moving through that still as well.
+                    else
+                        m_doctypeSearchCount = 0;
                     if (searchCount == 4) {
                         // Found '<!--' sequence
                         src.advancePastNonNewline();
@@ -1134,8 +1136,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
                         return state;
                     }
                     break;
-                }
-                else
+                } else
                     m_doctypeSearchCount = 0; // Stop looking for '<!DOCTYPE' sequence
             }