Reviewed by Tim H.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2006 18:03:12 +0000 (18:03 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2006 18:03:12 +0000 (18:03 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=11772
        REGRESSION: XMLSerializer.serializeToString incorrect value for CDATA nodes

        Test: fast/dom/serialize-cdata.html

        * editing/markup.cpp:
        (WebCore::startMarkup): Dump CDATA sections, too.

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

LayoutTests/ChangeLog
LayoutTests/fast/dom/serialize-cdata-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/serialize-cdata.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/markup.cpp

index 1be66ae57b8f4a3709562a6379aede304ea51357..389b4be06aa6fd29a47a485fbc320a6538badc7d 100644 (file)
@@ -1,3 +1,13 @@
+2006-12-08  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Tim H.
+
+        Test for http://bugs.webkit.org/show_bug.cgi?id=11772
+        REGRESSION: XMLSerializer.serializeToString incorrect value for CDATA nodes
+
+        * fast/dom/serialize-cdata-expected.txt: Added.
+        * fast/dom/serialize-cdata.html: Added.
+
 2006-12-08  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
 2006-12-08  Rob Buis  <buis@kde.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/dom/serialize-cdata-expected.txt b/LayoutTests/fast/dom/serialize-cdata-expected.txt
new file mode 100644 (file)
index 0000000..16988e0
--- /dev/null
@@ -0,0 +1,5 @@
+Test for bug 11772: XMLSerializer.serializeToString incorrect value for CDATA nodes.
+
+Should say PASS below.
+
+PASS
diff --git a/LayoutTests/fast/dom/serialize-cdata.html b/LayoutTests/fast/dom/serialize-cdata.html
new file mode 100644 (file)
index 0000000..70853fe
--- /dev/null
@@ -0,0 +1,15 @@
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11772">bug 11772</a>:
+XMLSerializer.serializeToString incorrect value for CDATA nodes.</p>
+<p>Should say PASS below.</p>
+<script>
+if (window.layoutTestController)
+  layoutTestController.dumpAsText();
+
+var d = window.document.implementation.createDocument("", "", null);
+var n = d.createCDATASection("-- <cdata> --");
+var s = (new XMLSerializer()).serializeToString(n);
+if (s == "<![CDATA[-- <cdata> --]]>")
+  document.write("PASS");
+else
+  document.write("FAIL");
+</script>
index ff67a5ab06dbce5aad713481107be3ecb7db627c..e33c1cb847d3a0e957370c96a51e300dcb45017a 100644 (file)
@@ -1,3 +1,15 @@
+2006-12-08  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Tim H.
+
+        http://bugs.webkit.org/show_bug.cgi?id=11772
+        REGRESSION: XMLSerializer.serializeToString incorrect value for CDATA nodes
+
+        Test: fast/dom/serialize-cdata.html
+
+        * editing/markup.cpp:
+        (WebCore::startMarkup): Dump CDATA sections, too.
+
 2006-12-08  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by hyatt.
 2006-12-08  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by hyatt.
index b9909eacdb2bc01a0dcc5a39ed834b520c2223b6..3a8e3404d5b2b8d9ad738c41145ebeca9b7afe43 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "markup.h"
 
 #include "config.h"
 #include "markup.h"
 
+#include "CDATASection.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSPropertyNames.h"
 #include "CSSRule.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSPropertyNames.h"
 #include "CSSRule.h"
@@ -252,8 +253,9 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
             
             return markup;
         }
             
             return markup;
         }
-        case Node::ATTRIBUTE_NODE:
         case Node::CDATA_SECTION_NODE:
         case Node::CDATA_SECTION_NODE:
+            return static_cast<const CDATASection*>(node)->toString().deprecatedString();
+        case Node::ATTRIBUTE_NODE:
         case Node::ENTITY_NODE:
         case Node::ENTITY_REFERENCE_NODE:
         case Node::NOTATION_NODE:
         case Node::ENTITY_NODE:
         case Node::ENTITY_REFERENCE_NODE:
         case Node::NOTATION_NODE: