W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2015

Re: [whatwg] Why CanvasRenderingContext2D uses WebIDL unrestricted float type?

From: Tetsuharu OHZEKI <saneyuki.snyk@gmail.com>
Date: Wed, 25 Mar 2015 23:54:32 +0900
Message-ID: <CACyPx==AkMQ=aueW=+8+TU-gYxzJXV=GiBT97YVp1eHgURmNjw@mail.gmail.com>
To: WHATWG <whatwg@lists.whatwg.org>
 I understand the reason.
Thank you!

Tetsuharu OHZEKI
2015/03/25 午前5:37 "Boris Zbarsky" <bzbarsky@mit.edu>:

> On 3/24/15 4:06 PM, Tetsuharu OHZEKI wrote:
>
>> But I think that, why don't  CanvasRenderingContext2D use restricted
>> float type defined in WebIDL if these methods ignore the value when
>> its is not finite?
>>
>
> Because they want to ignore the value.
>
>  By the current WebIDL spec
>> (http://heycam.github.io/webidl/#es-double), restricted values,
>> 'float' & 'double', will raise TypeError in conversion phase under
>> ECMAScript environment if the passed value is a NaN or +-Infinity.
>>
>
> Exactly.  That's not the same thing as ignoring the value.
>
>  For the purpose to ignore non-restricted values, I feel that it's more
>> better to restrict by IDL type.
>>
>
> Not if you want to actually _ignore_ the value (as opposed to throwing an
> exception).
>
> -Boris
>
Received on Wednesday, 25 March 2015 14:55:24 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:29 UTC