W3C home > Mailing lists > Public > www-svg@w3.org > February 2013

Re: Clarification on object bounding box specification

From: Robert Longson <longsonr@gmail.com>
Date: Thu, 14 Feb 2013 10:34:22 +0000
Message-ID: <CAOu7Uv5HmwLfMcEMFhfzTfGwKt=Skt_Rc2Dk7pSS571mmiTTjA@mail.gmail.com>
To: www-svg@w3.org
> Opera, IE10*, and Chrome* all follow the spec's wording.
> Firefox does not, and renders the stroked, horizontal patterned line.

> I think Firefox's implementation is the most intuitive for end users and I
> would like to propose we align on their interpretation of the spec.

Firefox does follow the spec's wording though! In many cases it won't
draw a horizontal/vertical
pattern or gradient. For instance we pass
http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/pservers-grad-17-b.html

So I'm sure you're now asking what's special about this case?

We'll disable the pattern in two cases when the width or height of the
object is zero:

a) there's no viewBox and the pattern content units are objectBoundingBox
b) there is a viewBox and the pattern units are objectBoundingBox

This is because:

The SVG specification says that the 'patternContentUnits' attribute
"has no effect if
attribute ‘viewBox’ is specified". We still need to include a bbox scale
if the viewBox is specified and _patternUnits_ is set to or defaults to
objectBoundingBox though, since in that case the viewBox is relative to the bbox

We wrote this code not so long ago to get our implementation to pass
http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/pservers-pattern-02-f.html

So are we right in our pattern logic?

Best regards

Robert.
Received on Thursday, 14 February 2013 10:34:54 GMT

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