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

On Wed, 27 Oct 2010 04:23:16 +0200, Cameron McCormack <cam@mcc.id.au>  
wrote:

> 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

-- 
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 UTC