W3C home > Mailing lists > Public > www-svg@w3.org > August 2012

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

From: Robert Longson <longsonr@gmail.com>
Date: Thu, 9 Aug 2012 12:37:38 +0100
Message-ID: <CAOu7Uv5pyhMVgaQW7JAzsBHGENVgTVFYe=p-CG9v8gpF9rAfKg@mail.gmail.com>
To: Alex Danilo <alex@abbra.com>
Cc: Philip Rogers <pdr@google.com>, Dirk Schulze <dschulze@adobe.com>, Rick <graham.rick@gmail.com>, "www-svg@w3.org" <www-svg@w3.org>, "jackalmage@gmail.com" <jackalmage@gmail.com>
> 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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:52 GMT