title: How is the getBBox() SVGRect calculated?
body: <p>I have a <code>g</code> element that contains one or more <code>path</code> elements. As I mentioned in <a href="https://stackoverflow.com/questions/6178189/stroke-width-doesnt-scale-aspect-ratio-problem">another question</a>, I scale and translate the <code>g</code> element by computing a <code>transform</code> attribute so that it fits on a grid in another part of the canvas.</p>
  
  <p>The calculation is done using the difference between two rectangles, the <code>getBBox()</code> from the <code>g</code> element and the rectangle around the grid.  </p>
  
  <p>Here is the question -- after I do the transform, I update the contents of the <code>g</code> element and call <code>getBBox()</code> again, <em>without</em> removing the <code>transform</code>. The resulting rectangle appears to be calculated without considering the <code>transform</code>. I would have expected it to reflect the change. Is this behavior consistent with the SVG specification?  How do I get the bounding box of the transformed rectangle?</p>
  
  <p>This, BTW, is in an HTML 5 document running in Firefox 4, if that makes any difference.</p>
  
  <p>Update:  Apparently this behavior seems pretty clearly in violation of the specification. From the text <a href="http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable" rel="noreferrer">here at w3c</a>:</p>
  
  <blockquote>
    <p><strong>SVGRect getBBox()</strong></p>
    
    <p>Returns the tight bounding box in current user space (i.e., after application of the ‘transform’ attribute, if any) on the geometry of all contained graphics elements, exclusive of stroking, clipping, masking and filter effects). 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.</p>
  </blockquote>
  
  <p>Am I reading this correctly? If so this seems to be an errata in the SVG implementation Firefox uses; I haven't had a chance to try any other. I would file a bug report if someone could point me to where.</p>