W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css3-images] Referencing <svg> element directly with element()

From: Dirk Schulze <dschulze@adobe.com>
Date: Fri, 24 Feb 2012 15:31:33 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Erik Dahlstrom <ed@opera.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <86790FB2-1022-4042-9993-610A1971EE5F@adobe.com>

On Feb 24, 2012, at 2:56 PM, Tab Atkins Jr. wrote:

> On Fri, Feb 24, 2012 at 2:35 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>> With the current change objectBoundingBox and userSpaceOnUse are identical (just different wording, which should be fixed). Is that intended? userSpaceOnUse is important to make relative units (like length) relative the viewport, while they are relative the object on 'objectBoundingBox'. I have nothing against this change. But in this case you should say that you always use objectBoundingBox and userSpaceOnUse gets ignored. Would that match you intention?
> 
> Huh?  They're definitely not identical (or at least, aren't intended
> to be).  User coordinates are completely different sizes in the two of
> them (matching standard SVG expectations, more or less).
Ah, I got the difference. 

objectBoundingBox:
"A single user coordinate is the width and height of the concrete object size."

userSpaceOnUse:
"User coordinates are sized equivalently to the CSS px unit."

I was more looking at the actual size of the area. This is important for relative values. For userSpaceOnUse, the area is typically the viewport size, for objectBoundingBox the bounding box of the element.

<svg viewBox="0 0 100 100">
<defs>
<pattern id="p1" x="0%" y="0%" width="100%" height="100%">

</pattern>

<rect width="50" height="50" fill="url(#p1)"/>
</svg>

The size of the pattern is 100,100 for patternUnits="userSpaceOnUse" and 50,50 for patternUnits="objectBoundingBox".

Still, if you take the same area size, this is fine for me.

Greetings,
Dirk 

> 
> ~TJ
Received on Friday, 24 February 2012 23:32:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:51 GMT