W3C home > Mailing lists > Public > public-html@w3.org > October 2007

Re: Radial gradients in <canvas>

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Fri, 26 Oct 2007 13:54:03 +0100
Message-ID: <4721E36B.9080209@cam.ac.uk>
To: Anne van Kesteren <annevk@opera.com>
CC: HTML WG <public-html@w3.org>

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.

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

 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. 
<http://bugs.webkit.org/show_bug.cgi?id=13537>), whereas the problems 
are much less significant if it simply renders an incorrect colour in a 
few places.

-- 
Philip Taylor
pjt47@cam.ac.uk
Received on Friday, 26 October 2007 12:54:15 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:50 UTC