[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at apple.com darin at apple.com
Thu Apr 8 00:55:24 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f6f8db0ce6ed48ac288208018c25023abfb9167a
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 6 01:35:52 2010 +0000

    CDATA sections are merged into Text nodes when normalize() is used
    https://bugs.webkit.org/show_bug.cgi?id=33191
    
    Reviewed by Dan Bernstein.
    
    WebCore:
    
    Test: fast/dom/Node/normalize-with-cdata.html
    
    * dom/Node.cpp:
    (WebCore::Node::normalize): Use nodeType instead of isTextNode.
    
    LayoutTests:
    
    * fast/dom/Node/normalize-with-cdata-expected.txt: Added.
    * fast/dom/Node/normalize-with-cdata.html: Added.
    * fast/dom/Node/script-tests/normalize-with-cdata.js: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52840 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1a91ca5..dbfc57d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-05  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        CDATA sections are merged into Text nodes when normalize() is used
+        https://bugs.webkit.org/show_bug.cgi?id=33191
+
+        * fast/dom/Node/normalize-with-cdata-expected.txt: Added.
+        * fast/dom/Node/normalize-with-cdata.html: Added.
+        * fast/dom/Node/script-tests/normalize-with-cdata.js: Added.
+
 2010-01-05  James Robinson  <jamesr at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt b/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt
new file mode 100644
index 0000000..f8291ef
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize-with-cdata-expected.txt
@@ -0,0 +1,15 @@
+Test of normalize on an XML document with CDATA.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Before normalize
+PASS serializer.serializeToString(xmlChunk) is "<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"
+PASS xmlChunk.documentElement.childNodes.length is 3
+After normalize
+PASS serializer.serializeToString(xmlChunk) is "<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"
+PASS xmlChunk.documentElement.childNodes.length is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/normalize-with-cdata.html b/LayoutTests/fast/dom/Node/normalize-with-cdata.html
new file mode 100644
index 0000000..a74ec70
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/normalize-with-cdata.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/normalize-with-cdata.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
new file mode 100644
index 0000000..d1e3efe
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
@@ -0,0 +1,22 @@
+description('Test of normalize on an XML document with CDATA.');
+
+var parser = new DOMParser();
+var serializer = new XMLSerializer();
+
+var xmlChunk = parser.parseFromString(
+    '<foo>' +
+    'This is some text before the CDATA' +
+    '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' +
+    'This is some text after the CDATA' +
+    '</foo>',
+    'application/xml');
+
+debug('Before normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+xmlChunk.documentElement.normalize();
+debug('After normalize');
+shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"');
+shouldBe('xmlChunk.documentElement.childNodes.length', '3');
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5e19f0e..9bcdc84 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-05  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        CDATA sections are merged into Text nodes when normalize() is used
+        https://bugs.webkit.org/show_bug.cgi?id=33191
+
+        Test: fast/dom/Node/normalize-with-cdata.html
+
+        * dom/Node.cpp:
+        (WebCore::Node::normalize): Use nodeType instead of isTextNode.
+
 2010-01-05  James Robinson  <jamesr at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 69e31b1..70485cc 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -681,7 +681,7 @@ void Node::normalize()
 
         // Merge text nodes.
         while (Node* nextSibling = node->nextSibling()) {
-            if (!nextSibling->isTextNode())
+            if (nextSibling->nodeType() != TEXT_NODE)
                 break;
             RefPtr<Text> nextText = static_cast<Text*>(nextSibling);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list