Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js

Issue 739433003: Remove CDATASection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
diff --git a/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
index f15671cb297551893414492c04ee795c8c363b65..dd4fbed712c393bc7457c13a9482941c1445df3c 100644
--- a/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
+++ b/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js
@@ -6,11 +6,16 @@ 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]]>' +
+ // The parser converts CDATA to Text, so the script converts this comment to CDATA.
+ '<!--This is some <bold>markup</bold> inside of a CDATA-->' +
'This is some text after the CDATA' +
'</foo>',
'application/xml');
+var comment = xmlChunk.documentElement.childNodes[1];
+var cdata = document.implementation.createDocument(null, null).createCDATASection(comment.data);
+xmlChunk.documentElement.replaceChild(cdata, comment);
+
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');
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698