Created attachment 329474 [details] testcase (Re-reporting bug 444576, which got a little messy.) The innerHTML in an XHTML document setter accepts "pure XML" entities such as & but rejects HTML-specific entities such as &nsbp;. I think it should accept both. (It would be even better if it went beyond that and took the DTD into consideration; see bug 325581 for an example with MathML entities.) Quick survey of browser behaviors on Tiger: * Firefox trunk: NS_ERROR_INVALID_POINTER * Firefox 2: NS_ERROR_DOM_SYNTAX_ERR * Safari: NO_MODIFICATION_ALLOWED_ERR (clearly a lie, since it allows &) * Opera: Works.
What does HTML5 say here?
That Firefox is correct. http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#innerhtml basically says to create a new XML parser. The only bits you feed to it are the element start tag including namespace prefixes and the default namespace in scope. No entity declarations and such.