1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <p>This test checks whether serialized invalid XHTML is valid XML (for bug 9901).</p>
5 <p>If the test passes, you'll see a series of 'PASS' messages below.</p>
6 <pre id="console"></pre>
9 if (window.layoutTestController)
10 layoutTestController.dumpAsText();
14 document.getElementById('console').appendChild(document.createTextNode(s));
17 function shouldBe(a, b)
27 log('PASS: ' + a + ' should be ' + b + ' and is.\n');
29 log('FAIL: ' + a + ' should be ' + b + ' but instead is ' + evalA + '.\n');
32 var doc = (new DOMParser()).parseFromString('<input xmlns="http://www.w3.org/1999/xhtml">123</input>', 'text/xml');
33 var str = (new XMLSerializer()).serializeToString(doc);
35 shouldBe('doc.firstChild.firstChild.nodeValue', '123');
36 shouldBe('str', '<input xmlns=\"http://www.w3.org/1999/xhtml\">123</input>');