Re: [css-images] Reference SVG paint servers with url()

On Oct 26, 2014, at 8:14 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Sat, Oct 25, 2014 at 11:07 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>> On Oct 25, 2014, at 5:47 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>> On Fri, Oct 24, 2014 at 10:50 PM, Dirk Schulze <dschulze@adobe.com> wrote:
>>>> I would like to suggest that it is possible to reference SVG paint servers like <pattern>, <linearGradient> or <radialGradient> with url() and that this get added to the specification.
>>>> 
>>>> The ‘fill' and ‘stroke' properties are the first properties to support references of SVG paint servers with url(). Both got extended in SVG2 to match the syntax of the ‘background’ shorthand property and therefore support CSS images as well.
>>>> 
>>>> A recent change of SVG image handling, where an SVG document won’t be able to load further sub resources, solves the cross origin issue we had before.
>>>> 
>>>> In WebKit we experimented with this way to reference SVG paint server resources and the result looks promising.
>>> 
>>> So you solved the "images and resources use different code paths"
>>> problem?  That's what was blocking us before.
>> 
>> Yes, we did. Both use a similar code path in our experiment. More important, they have the same requirements for fetching.
> 
> Cool!
> 
>>>> One difference to normal CSS Images: SVG paint servers are potentially infinite in size and won’t be clipped, repeated or sized by other properties. I could imagine to have special behaviors when referenced with element() or image().
>>> 
>>> They're no different than CSS gradients.  They'll still respond to CSS
>>> giving them a box of a certain size to fill; they just don't scale
>>> with the box size, like CSS gradients do.  They will definitely clip
>>> or repeat when CSS wants them to, such as in a 'background' property.
>> 
>> On a 'per property’ decision might work. Will check. For fill an stroke there must be no clipping.
> 
> 'fill' and 'stroke' both use concrete sizes that are equal or larger
> than the visible area, so there's nothing to (visibly) clip.

Could you elaborate what you mean? By default, a paint server is sized taking the object bounding box as reference box. However, the stroke area is usually bigger than that. This is the reason why a paint server is potentially unbound.

Greetings,
Dirk

> 
> ~TJ

Received on Sunday, 26 October 2014 10:04:51 UTC