facebook/react — pull request #1932 by marianoguerra (2014-07-25 17:51:20+00:00)
Title: use adoptNode to set the correct namespace in case of svg

there's an issue rendering svg on browsers that are not chrome.

the issue is tracked here: https://github.com/facebook/react/issues/1900

the problem seems to be that using innerHTML on svg only works on chrome, on other browsers it doesn't set the correct namespace and this makes the svg to be there but not to render.

a set of potential solution were explored here:

http://marianoguerra.github.io/bugs/svgbug/

and the one that seems to work on most browsers and causes the least amount of changes is to use importNode/adoptNode before adding the child content in case it's svg instead of using innerHTML.

a first approach for a fix is here, there's a failing test but it was failing before this change was done.

I will inline comments on the code since there are some further improvements that I think can be done.