W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2013

Re: [whatwg] proposal: Add support for masking to canvas

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 30 Jan 2013 01:05:29 -0500
Message-ID: <5108B829.1020703@mit.edu>
To: Rik Cabanier <cabanier@gmail.com>
Cc: WHATWG <whatwg@lists.whatwg.org>, "Tab Atkins Jr." <jackalmage@gmail.com>
On 1/30/13 12:55 AM, Rik Cabanier wrote:
>        void maskImage(optional MaskOptions options);
>
> Why is it optional?

Because http://dev.w3.org/2006/webapi/WebIDL/#idl-operations says (if 
you scroll down a ways):

   If the type of an argument is a dictionary type or a union type that
   has a dictionary type as one of its flattened member types, and this
   argument is either the final argument or is followed by an optional
   argument, then the argument MUST be specified as optional.  Such
   arguments are always considered to have a default value of an empty
   dictionary, unless otherwise specified.

> It's not optional for 'addHitRegion' in the spec either...

Well, then whenever someone tries to actually parse that IDL with a 
WebIDL parser/validator they'll come filing bugs.  ;)

-Boris
Received on Wednesday, 30 January 2013 06:05:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:12 GMT