1 <html xmlns=
"http://www.w3.org/1999/xhtml" xmlns:
foo=
"http://www.example.com/foo">
2 <script type=
"text/javascript">
5 li
= document
.createElementNS('http://www.w3.org/1999/xhtml', 'li');
6 li
.appendChild(document
.createTextNode(str
));
7 document
.getElementById('console').appendChild(li
);
11 if (window
.testRunner
)
12 testRunner
.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')
20 debug('namespace is incorrect (' + e
.firstChild
.namespaceURI
+ ')');
22 if (e
.lastChild
.namespaceURI
== 'http://www.example.com/foo')
23 debug('namespace is correct')
25 debug('namespace is incorrect (' + e
.lastChild
.namespaceURI
+ ')');
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>