Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / XMLSerializer.html
blob58cae4db84a18a0cd3ad62ad4da12542e9b3e08d
1 <html>
2 <head>
3 <script>
4 function debug(str) {
5 li = document.createElement('li');
6 li.appendChild(document.createTextNode(str));
7 document.getElementById('console').appendChild(li);
10 function parseDocument() {
11 str = '<test><child1>First child</child1>';
12 str += '<child2 attr="an attribute">Second child</child2>';
13 str += '<!-- A comment --></test>';
15 parser = new DOMParser();
16 doc = parser.parseFromString(str, 'text/xml');
19 return doc;
22 function runTests() {
23 if (window.testRunner) {
24 testRunner.dumpAsText();
27 doc = parseDocument();
29 child1 = doc.documentElement.firstChild;
30 child2 = child1.nextSibling
31 comment = child2.nextSibling;
33 fragment = doc.createDocumentFragment();
34 fragment.appendChild(doc.documentElement.cloneNode(true))
36 serializer = new XMLSerializer();
38 debug(serializer.serializeToString(child1));
39 debug(serializer.serializeToString(child2));
40 debug(serializer.serializeToString(comment));
41 debug(serializer.serializeToString(doc));
42 debug(serializer.serializeToString(fragment));
46 </script>
47 </head>
48 <body onload="runTests()">
49 This tests XMLSerializer on different node types. If the test is successful, there should be five lines of output. The first line should be the child1 tag. The second should be the child2 tag. The third one should be a comment, the fourth one should be the complete document and the fifth one should be the complete document but serialized from a document fragment node.
50 <ul id="console">
51 </ul>
52 </body>
53 </html>