HeinrichApfelmus / threepenny-gui

GUI framework that uses the web browser as a display.
https://heinrichapfelmus.github.io/threepenny-gui/
Other
437 stars 77 forks source link

[Q] set html "<tag/>" to "<svg>" lost in IE11 #224

Open ggreif opened 5 years ago

ggreif commented 5 years ago

Update: there is no need for the inner, simply set html already shows the issue. Am I using it correctly in the proper namespace? I tried set html "<svg:g hhh=''/>" and that still won't do it.

I have a little snippet that behaves differently on IE11 and Firefox:

do test <- SVG.svg
    inner <- SVG.circle
    pure test # set html "<g hhh=''/>" #+ [pure inner]
    pure body #+ [ UI.div #+ [pure test] ]

In IE11 I get as DOM:

<svg xmlns="http://www.w3.org/2000/svg"><circle /></svg>

while in Mozilla I get

<svg><g hhh=""></g><circle></circle></svg>

Note the absence of <g> in the former. This does not happen in IE when I add stuff to a <div> in the same manner.

Am I using set html ... correctly for adding elements to an <svg> tag? At least one SVG example advertises this way. Or is the IE11 (or the threepenny binding) buggy? Is Firefox buggy to accept this?

bradrn commented 5 years ago

I don't know if it's relevant, but isn't #223 also about problems with IE11?

ggreif commented 5 years ago

@bradrn no I am already running with the IE11 fix for #223 :-)

HeinrichApfelmus commented 4 years ago

Am I using set html ... correctly for adding elements to an tag? At least one SVG example advertises this way.

You should use the functions from the Graphics.UI.Threepenny.SVG.* modules, they use the correct namespace. Using set html is not recommended — it is called html, after all. 😅 Looks like a namespace issue, indeed, but I don't know how fix that.

Which example suggests set html? If it is in the Threepenny repository, I should probably remove it.