As quoted from the spec in this thread I think it's this
Note that getBBox must return the actual bounding box at the time the method was called, even in case the element has not yet been rendered.
The "even in the case the element has not yet been rendered" seems to be the sticking point for IE, this problem persists a year later now on IE11. The only other possibility that I can see out of experience is that with g tags not having an explicit width and height according to the spec IE might just be foregoing this check completely, as in "to not have a width" is presumably the same as 0 for the IE codebase.
So the workaround would be to look for the biggest child as you go. In your particular case as a workaround you can just grab the lastChild
when you add it to the g tag. Change the JS code in the fiddle to this (I fixed the svgns thing too as mentioned by Thomas W in the comments).
var temp;
temp = document.createElementNS("http://www.w3.org/2000/svg","text");
temp.appendChild(document.createTextNode(".."));
temp.setAttribute("x",38);
temp.setAttribute("y",18);
document.getElementById("tata").appendChild(temp);
alert(document.getElementById("tata").lastChild.getBBox().width);
As you can see it's just the last line I've changed shoving in lastChild
before getBBox()
, should alert an 8 instead of a 0 now as Firefox and your other browsers did.