Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / set-innerHTML.xhtml
blobbe3acde48d635335b04882f6d13e3a8111054eef
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.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')
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>