W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [ambient light events LC] Feedback

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 18 Dec 2012 11:19:23 -0800
Message-ID: <50D0C1BB.7070400@mit.edu>
To: public-webapps@w3.org
On 12/18/12 10:47 AM, Tab Atkins Jr. wrote:
> Makes sense, I guess (though I'm not super happy with having to
> explicitly add the empty string to every enum that's supposed to be
> "nullable").  In that case, the IDL would be:
>
> enum LightLevel { "dim", "normal", "bright", "" };
> [Constructor (DOMString type, optional LightLevelEventInit eventInitDict)]
> interface LightLevelEvent : Event {
>      readonly attribute LightLevel value;
> };
> dictionary LightLevelEventInit : EventInit {
>      LightLevel value = "";
> };

If you really want it nullable, why not make it nullable?  As in:

   dictionary LightLevelEventInit : EventInit {
       LightLevel? value = null;
   };

This would incidentally work a lot better with { value: undefined } than 
the proposal above...

What am I missing?

-Boris
Received on Tuesday, 18 December 2012 19:19:54 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:56 GMT