Clarification on getBBox() with shapes of zero width

Hello www-svg!

I'm looking for clarification on what getBBox() should return for this:
<rect height="100" width="0" />

I think the correct result is to return an SVGRect of width 0 and height
100. This is due to the following sections of the spec:
[1] "A negative value is an error. A value of zero disables rendering of
the element."
[2] "Returns the tight bounding box in current user space ... 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."

Currently in browserland Opera and IE9 agree with me; Firefox, Chrome, and
Safari disagree and return a bounding box of size (0,0).

This recently came up as part of
https://bugs.webkit.org/show_bug.cgi?id=93290

[1]
http://www.w3.org/TR/SVG/single-page.html#shapes-RectElementWidthAttribute
[2]
http://www.w3.org/TR/SVG/single-page.html#types-__svg__SVGLocatable__getBBox

Thanks,
Philip

Received on Monday, 6 August 2012 21:33:48 UTC