This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Consider the following code: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head"> </head> <body> <script><![CDATA[ var shadowRoot = document.getElementById('head').createShadowRoot(); console.log(shadowRoot.namespaceURI); // What should be printed? shadowRoot.innerHTML = "<title />"; console.log(shadowRoot.firstChild.namespaceURI); // How about this one? document.documentElement.setAttribute('xmlns', 'http://example.com/foobar'); console.log(shadowRoot.firstChild.namespaceURI); // Does it change? ]]></script> </body> </html> It is unclear from the specification whether XML namespace is derived over host-shadow boundary. Probably this should be clarified.
This follows from how DocumentFragment and innerHTML work. First prints null I think, second null as well, and you cannot change namespaces.