- From: <bugzilla@jessica.w3.org>
- Date: Mon, 21 Jul 2014 10:03:47 +0000
- To: www-dom@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26396 Bug ID: 26396 Summary: innerHTML depends on node document; doesn't look at element context Product: WHATWG Version: unspecified Hardware: PC OS: All Status: NEW Severity: normal Priority: P2 Component: DOM Parsing and Serialization Assignee: Ms2ger@gmail.com Reporter: dschulze@adobe.com QA Contact: sideshowbarker+domparsingspec@gmail.com CC: mike@w3.org, public-webapps-bugzilla@w3.org, www-dom@w3.org http://domparsing.spec.whatwg.org/#innerhtml [[ On getting, if the context object's node document is an HTML document, then the attribute must return the result of running the HTML fragment serialization algorithm on the context object; otherwise, the context object's node document is an XML document, ]] Currently innerHMTML just looks at the node document. This is maybe not enough. The elements context itself seems to be interesting as well to set the namespace of elements. <div><svg id="svg"></svg></div> <script> document.getElementById('svg').innerHTML = '<g><rect width="100" height="100"/></g>'; </script> doesn't work. while <div><svg id="svg"></svg></div> <script> document.getElementById('svg').innerHTML = '<svg><g><rect width="100" height="100"/></g></svg>'; </script> works in most browsers. (In all, if it gets called on <div>.) It gets of course more complicated when innerHTML is called on an element within <foreignObject>: <foreignObject width="100" height="50" requiredExtensions="http://www.w3.org/1999/xhtml"> <!-- XHTML content goes here --> <body xmlns="http://www.w3.org/1999/xhtml"> <p>Here is a paragraph that requires word wrap</p> </body> </foreignObject> Here the node document is probably not the SVG root document. Also, for standalone SVG files, it would be great if authors don't need to specify the SVG namespace on elements in the "value" string. With the text above, it seems to be necessary. At least it is not clear to me how the output would be an SVG element. Especially for HTML documents with SVG content, this issue has been brought up to the SVG WG many times. -- You are receiving this mail because: You are on the CC list for the bug.
Received on Monday, 21 July 2014 10:03:50 UTC