2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / set-innerHTML.xhtml
blobb40123fdcc695573bd53ca296081fc115ace50be
1 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="http://www.example.com/foo">
2 <script type="text/javascript">
3 <![CDATA[
4 function debug(str) {
5 li = document.createElementNS('http://www.w3.org/1999/xhtml', 'li');
6 li.appendChild(document.createTextNode(str));
7 document.getElementById('console').appendChild(li);
10 function runTests() {
11 if (window.layoutTestController)
12 layoutTestController.dumpAsText();
14 e = document.getElementById('test');
15 e.innerHTML = '<b>Success!</b><foo:bar></foo:bar>';
17 if (e.firstChild.namespaceURI == 'http://www.w3.org/1999/xhtml')
18 debug('namespace is correct')
19 else
20 debug('namespace is incorrect (' + e.firstChild.namespaceURI + ')');
22 if (e.lastChild.namespaceURI == 'http://www.example.com/foo')
23 debug('namespace is correct')
24 else
25 debug('namespace is incorrect (' + e.lastChild.namespaceURI + ')');
27 ]]>
28 </script>
29 <body onload="runTests();">
30 <p>This tests that setting innerHTML on an xhtml document works and respects namespaces and unknown namespace prefixes. If this test is successful, the text below should say "Success", and "namespace is correct" TWICE.</p>
31 <p id="test"/>
32 <ul id="console"/>
33 </body>
34 </html>