innerHTML-setter-default-namespace.xhtml (1295B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 </head> 7 <body> 8 <span xmlns="someNamespace" xmlns:html="http://www.w3.org/1999/xhtml"> 9 <html:span id="target"/> 10 </span> 11 <script> 12 <![CDATA[ 13 14 test(() => { 15 const element = document.getElementById("target"); 16 element.innerHTML = '<b /><html:b />'; 17 assert_equals(element.firstChild.prefix, null); 18 assert_equals(element.firstChild.namespaceURI, "someNamespace"); 19 assert_equals(element.lastChild.prefix, 'html'); 20 assert_equals(element.lastChild.namespaceURI, "http://www.w3.org/1999/xhtml"); 21 }, "Setting innerHTML on a HTML element with a non-HTML namespace as the default namespace"); 22 23 test(() => { 24 const element = document.getElementById("target"); 25 element.outerHTML = '<b /><html:b />'; 26 assert_equals(element.firstChild.prefix, null); 27 assert_equals(element.firstChild.namespaceURI, "someNamespace"); 28 assert_equals(element.lastChild.prefix, 'html'); 29 assert_equals(element.lastChild.namespaceURI, "http://www.w3.org/1999/xhtml"); 30 }, "Setting outerHTML on a HTML element with a non-HTML namespace as the default namespace"); 31 32 ]]> 33 </script> 34 </body> 35 </html>