Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / serialize-nodes.xhtml
blobe9975bef22ae45e83eda51c2da4a851039a12fca
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="http://foo.com" xmlns:bar="http://bar.com" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>XMLSerializer() namespace test</title>
6 <script>
7 window.addEventListener("load", function() {
8 if (window.testRunner)
9 testRunner.dumpAsText();
11 var xs = new XMLSerializer();
12 var content = document.getElementById('content');
13 content.firstChild.nodeValue = xs.serializeToString(document.getElementById('input'));
15 // Original test
16 var d = document.implementation.createDocument("urn:foo-ns", "foo:root", null);
17 if (!d.documentElement) {
18 // This shouldn't happen, since DomImplementation.createDocument
19 // is supposed to create the root element. But in Safari, it's required.
20 d.appendChild(d.createElementNS("urn:foo-ns", "foo:root"));
22 var root = d.documentElement;
23 root.setAttributeNS("urn:foo-ns", "foo:type", "test")
25 var c = d.createElementNS(null, "child");
26 root.appendChild(c);
28 c.setAttributeNS("urn:foo-ns", "foo:name", "one");
29 c.setAttributeNS("urn:bar-ns", "bar:name", "two");
30 var attr = d.createAttributeNS(null, "name");
31 attr.value = "three";
32 c.setAttributeNode(attr);
34 window.alert("foo:name is " + c.getAttributeNS("urn:foo-ns", "name") + " and should be one");
35 window.alert("bar:name is " + c.getAttributeNS("urn:bar-ns", "name") + " and should be two");
36 window.alert("name is " + c.getAttributeNS(null, "name") + " and should be three");
37 window.alert("node is " + d.getElementsByTagNameNS(null, "child").item(0).nodeName + " and should be child");
38 window.alert(xs.serializeToString(d));
39 }, false);
40 </script>
41 </head>
42 <body>
43 <pre id="content">foo</pre>
44 <div id="input">
45 <div>
46 <foo:node xmlns="http://baz.com" foo:name="foo_name" bar:name="bar_name">
47 <node foo:name="foo_name">
48 <bar:node xmlns:bar="http://bar2.com"/>
49 </node>
50 </foo:node>
51 </div>
52 <bar:node>
53 <br />
54 </bar:node>
55 </div>
56 </body>
57 </html>