Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / dom-parse-serialize-xmldecl.html
blobd7fec8f02105e5663c998ab83b587b7b5f5188e2
1 <html>
2 <script src="../../resources/js-test.js"></script>
3 <script type="text/javascript">
4 description("This test verifies that the xml declaration gets serialized if present.");
6 var xmlpi = '<?xml version="1.0" encoding="UTF-8"?>';
7 var markup = xmlpi + '<root><test/></root>';
8 var xmldoc = new DOMParser().parseFromString(markup, "text/xml");
9 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0' encoding='UTF-8'?><root><test/></root>");
11 xmlpi = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
12 markup = xmlpi + '<root><test/></root>';
13 xmldoc = new DOMParser().parseFromString(markup, "text/xml");
14 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0' encoding='UTF-8' standalone='yes'?><root><test/></root>");
16 xmlpi = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
17 markup = xmlpi + '<root><test/></root>';
18 xmldoc = new DOMParser().parseFromString(markup, "text/xml");
19 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0' encoding='UTF-8' standalone='no'?><root><test/></root>");
21 xmlpi = '<?xml version="1.0" standalone="yes"?>';
22 markup = xmlpi + '<root><test/></root>';
23 xmldoc = new DOMParser().parseFromString(markup, "text/xml");
24 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0' standalone='yes'?><root><test/></root>");
26 xmlpi = '<?xml version="1.0" standalone="no"?>';
27 markup = xmlpi + '<root><test/></root>';
28 xmldoc = new DOMParser().parseFromString(markup, "text/xml");
29 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0' standalone='no'?><root><test/></root>");
31 xmlpi = '<?xml version="1.0"?>';
32 markup = xmlpi + '<root><test/></root>';
33 xmldoc = new DOMParser().parseFromString(markup, "text/xml");
34 shouldBeEqualToString("new XMLSerializer().serializeToString(xmldoc).replace(/\"/g,\"'\")", "<?xml version='1.0'?><root><test/></root>");
36 </script>
37 </html>