[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
darin at apple.com
darin at apple.com
Wed Jan 20 22:13:40 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 10da2aae622d53e872ca63edc99bcac80e62d439
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