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

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

From: Dirk Schulze <dschulze@adobe.com>
Date: Mon, 6 Aug 2012 16:55:22 -0700
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Philip Rogers <pdr@google.com>, "www-svg@w3.org" <www-svg@w3.org>
Message-ID: <118FBD57-06E4-4506-B1F4-4DC19DDF86E1@adobe.com>

On Aug 6, 2012, at 2:55 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Mon, Aug 6, 2012 at 2:33 PM, Philip Rogers <pdr@google.com> wrote:
>> 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
> 
> Yes, (0, 100) should be the correct answer.  It would be great if we
> could change to align with IE and Opera here, so that answer has a
> majority and FF can change.

Well, it depends on the interpretation of ""A negative value is an error. A value of zero disables rendering of the
element". Actually it says it should not be rendered. So no renderer is created, like for display: none? I would interpret it as not rendering, no renderer, no bounding box. So FF and Webkit behavior sound reasonable before.

We had bug reports for that on WebKit before and discussed it with people from Mozilla and they had the same understanding.

Greetings,
Dirk

> 
> ~TJ
> 
Received on Monday, 6 August 2012 23:55:51 GMT

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