LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2007 02:36:16 +0000 (02:36 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2007 02:36:16 +0000 (02:36 +0000)
        Reviewed by Darin.

        - test for http://bugs.webkit.org/show_bug.cgi?id=13166
          REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table

        * fast/tokenizer/write-partial-entity-expected.txt: Added.
        * fast/tokenizer/write-partial-entity.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13166
          REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table

        Test: fast/tokenizer/write-partial-entity.html

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::parseTag): Reordered to avoid resetting the buffer position
        after script execution which can write to the buffer.

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

LayoutTests/ChangeLog
LayoutTests/fast/tokenizer/write-partial-entity-expected.txt [new file with mode: 0644]
LayoutTests/fast/tokenizer/write-partial-entity.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLTokenizer.cpp

index ecd9ffa..0d33baf 100644 (file)
@@ -1,3 +1,13 @@
+2007-03-29  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=13166
+          REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table
+
+        * fast/tokenizer/write-partial-entity-expected.txt: Added.
+        * fast/tokenizer/write-partial-entity.html: Added.
+
 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by john
diff --git a/LayoutTests/fast/tokenizer/write-partial-entity-expected.txt b/LayoutTests/fast/tokenizer/write-partial-entity-expected.txt
new file mode 100644 (file)
index 0000000..9931f3d
--- /dev/null
@@ -0,0 +1,20 @@
+Test for http://bugs.webkit.org/show_bug.cgi?id=13166 REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table.
+
+The following lines should all say “1 < 2”. They should not contain ampersands.
+
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+1 < 2
+
diff --git a/LayoutTests/fast/tokenizer/write-partial-entity.html b/LayoutTests/fast/tokenizer/write-partial-entity.html
new file mode 100644 (file)
index 0000000..9ccd3b4
--- /dev/null
@@ -0,0 +1,33 @@
+<html>
+<head>
+    <title></title>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    </script>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13166">http://bugs.webkit.org/show_bug.cgi?id=13166</a>
+        REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table</i>.
+    </p>
+    <p>
+        The following lines should all say &ldquo;1 &lt; 2&rdquo;. They should not contain ampersands.
+    </p>
+    1 <script>document.write("&lt")</script>; 2<br>
+    1 <script>document.write("&l")</script>t; 2<br>
+    1 <script>document.write("&")</script>lt; 2<br>
+    1 <script>document.write("&")</script>#x3c; 2<br>
+    1 <script>document.write("&#")</script>x3c; 2<br>
+    1 <script>document.write("&#x")</script>3c; 2<br>
+    1 <script>document.write("&#x3")</script>c; 2<br>
+    1 <script>document.write("&#x3c")</script>; 2<br>
+    1 <script>document.write("&#x3c")</script> 2<br>
+    1 <script>document.write("&")</script>#x3c; 2<br>
+    1 <script>document.write("&")</script>#60; 2<br>
+    1 <script>document.write("&#")</script>60; 2<br>
+    1 <script>document.write("&#6")</script>0; 2<br>
+    1 <script>document.write("&#60")</script>; 2<br>
+    1 <script>document.write("&#60")</script> 2<br>
+</body>
+</html>
index ecb0c36..7ad47f0 100644 (file)
@@ -1,3 +1,16 @@
+2007-03-29  Mitz Pettel  <mitz@webkit.org>
+
+        Reviewed by Darin.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=13166
+          REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table
+
+        Test: fast/tokenizer/write-partial-entity.html
+
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::parseTag): Reordered to avoid resetting the buffer position
+        after script execution which can write to the buffer.
+
 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by john
index 82d7071..ca3a845 100644 (file)
@@ -1161,6 +1161,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
             }
 
             RefPtr<Node> n = processToken();
+            m_cBufferPos = cBufferPos;
             if (n) {
                 if ((tagName == preTag || tagName == listingTag) && !inViewSourceMode()) {
                     if (beginTag)
@@ -1225,7 +1226,6 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
             }
             if (tagName == plaintextTag)
                 state.setInPlainText(beginTag);
-            m_cBufferPos = cBufferPos;
             return state; // Finished parsing tag!
         }
         } // end switch