PDA

View Full Version : SVG contents do not render in Chrome after replacing



TAG
1 Sep 2009, 12:08 AM
Hello,
I have this XHTML code with SVG inside


....
<div id="contenitore" xmlns:svg="http://www.w3.org/2000/svg">
<svg:svg id="pippoSVG" version="1.1">
<svg:rect style="fill:red;" width="100" height="100" x="0" y="0" />
</svg:svg>
</div>
....


I use the "remove" and "insertHTML" methods for replace the object SVG.


var app=Ext.get(idOggetto).getBox(true,true);
var pp=AreaCentrale.getActiveTab();//The panel that contains the object SVG
Ext.get("pippoSVG").remove();//remove
pp.doLayout();
Ext.get(idOggetto).insertHtml('beforeEnd','<svg:svg id="pippoSVG" version="1.1"><svg:rect style="fill:black;" width="200" height="100" x="0" y="0" /></svg:svg>');//insert new code
pp.doLayout();


in Mozzilla I haven't a problem, the code remove old SVG and insert new SVG, but in Chrome, this code remove old SVG but not insert new code SVG.
Anyone know give me directions on this?

Note this code insert in event "resize" in option "listener" in resize object.