Re: Radial gradients in <canvas>

On Fri, 26 Oct 2007 14:54:03 +0200, Philip Taylor <> wrote:
> Anne van Kesteren wrote:
>> To quote from an internal discussion: "IMO having an inner circle that  
>> goes outside the outer circle is a bug in the script and I would prefer  
>> to just throw an error if that happens.
> In that case, authors would have to remember/discover that
>    ctx.createRadialGradient(10, 10, 100, 20, 20, 0)
> is an error and has to be rewritten as
>    ctx.createRadialGradient(20, 20, 0, 10, 10, 100)
> Under the current spec, those are equivalent if one circle is inside the  
> other, which makes it easier for authors to get it working like they  
> expect.

I haven't checked, but I don't believe that's the issue.

> (The cases when neither circle is inside the other seem pretty obscure  
> to me, so I don't think the behaviour matters much there.)

Well, the specification defines what should happen there too. I think  
that's the main problem.

> From a UA's perspective, throwing errors in certain cases seems slightly  
> dangerous, since code written for 'old' (i.e. current) browsers may  
> (intentionally or accidentally) trigger those cases and will not be  
> expecting an exception. If a UA starts throwing in those cases, the  
> whole application is likely to break (see e.g.  
> <>), whereas the problems  
> are much less significant if it simply renders an incorrect colour in a  
> few places.

Yeah, agreed. Although I'd like for there to be no differences in color  
across implementations.

Anne van Kesteren

Received on Saturday, 27 October 2007 09:02:42 UTC