W3C home > Mailing lists > Public > public-svg-wg@w3.org > October to December 2010

Re: gradients with no offset=0 or offset=1 stops

From: Erik Dahlstrom <ed@opera.com>
Date: Wed, 27 Oct 2010 15:15:33 +0200
To: public-svg-wg@w3.org
Message-ID: <op.vk8kf7s4geuyw5@localhost>
On Wed, 27 Oct 2010 04:23:16 +0200, Cameron McCormack <cam@mcc.id.au>  

> Is it defined what the rendering behaviour is of gradients that don’t
> have a stop at offset 0 or 1?  Test:
>   http://dev.w3.org/SVG/profiles/1.1F2/ua-tests/gradient-offset.svg
> There are two subtests there.  The top one uses the default
> spreadMethod="pad", while the bottom one has spreadMethod="repeat".
> The definition of spreadMethod says:
>   Indicates what happens if the gradient starts or ends inside the bounds
>   of the target rectangle.
> Does the gradient starting or ending inside the bounds of the target
> rectangle include the parts of the gradient between 0 & the first stop
> and the last stop & 1?
> All implementations I tested (Firefox, Chrome, Opera, IE, Batik, Safari)
> rendered the top rectangle as if it had offset 0 = black and offset 1 =
> lime.  This was the rendering for the bottom rectangle, too, except for
> Firefox which has offset 0 = offset 1 = #007f00 (approx), which is kind
> of weird.

If you want the (the lower) gradient to repeat or reflect, don't you also  
need to specify the gradient vector such that it doesn't fill the entire  
destination? Defaults are: x1=y1=y2=0%, x2=100%.

Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Wednesday, 27 October 2010 13:16:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 October 2010 13:16:13 GMT