W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2012

Re: Named constant as default value

From: Cameron McCormack <cam@mcc.id.au>
Date: Sat, 14 Apr 2012 23:07:37 +1000
Message-ID: <4F897699.3030904@mcc.id.au>
To: Seo Sanghyeon <sanxiyn@gmail.com>
CC: public-script-coord@w3.org, www-dom@w3.org
Seo Sanghyeon:
> 2012-04-05 working draft of DOM4 (same in editor's draft) introduced:
> http://www.w3.org/TR/dom/
> interface Document {
>    NodeIterator createNodeIterator(Node root, optional unsigned long
> whatToShow = SHOW_ALL, optional NodeFilter? filter = null);
> };
> SHOW_ALL is 0xFFFFFFFF, but it seems such use of named constant
> as default value is not allowed by WebIDL grammar, either working draft
> or editor's draft.
> Which of the following is true?
> 1. WebIDL specification should be updated.
> 2. DOM4 specification should be updated.
> 3. It is okay for DOM4 specifcation WebIDL to be non-conforming.
> It is for illustrative purpose.

Either (1) and (2), or just (2).  If we wanted to allow the constant to 
be used here, it'd need to be NodeFilter.SHOW_ALL or 
NodeFilter::SHOW_ALL.  But given that we're trying to move away from 
numeric constants, I'm not sure if it's worth allowing them to be used 
as default values.
Received on Saturday, 14 April 2012 13:08:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:09 GMT