Re: Clarification on getBBox() with shapes of zero width

> getBBox() "Returns the tight bounding box in current user space"
> therefore is independent of any rasterizers, Cairo or anything like that.

Getting the bounding box of a path with cubic/quadratic besziers is
non-trivial. Cairo does this for us.

>
> Robert, I very much doubt the code in FF is reaching down into Cairo
> to get the boudning box unless you are doing some weird reverse transform
> that I did at one time and found it couldn't follow the getBBox implementation
> rules and tests.

http://mxr.mozilla.org/mozilla-central/source/layout/svg/base/src/nsSVGPathGeometryFrame.cpp#354.

>
> So no doubt (0,100) is correct.
>
> Similarly, display:none has no effect on the user space co-ordinate system
> and should return the same values.

If you want this included then set the visibility to hidden. Its very
hard for Firefox to meet the svg specification requirements on
display:none as we're constrained by html implementation performance
e.g. having things such as markers render when they are set to
display:none.

>
> Philip is correct, Opera is the only implementation in the tested group
> that does the correct thing.
>
> Returning a value of (0,0) for display:none is wrong - the calculation
> should be done in user space where the element exists and whether it
> gets rendered or not is immaterial in regard to its actual geometry.
>

I suspect we'll just continue to be wrong then in what to me, are edge
cases which can be worked around by authors anyway .

Best regards

Robert.

Received on Thursday, 9 August 2012 11:38:09 UTC