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

Re: DOM collections index out of bounds and JavaScript.

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 29 Oct 2010 15:17:19 +0200
To: "Cameron McCormack" <cam@mcc.id.au>
Cc: "Garrett Smith" <dhtmlkitchen@gmail.com>, "Erik Arvidsson" <arv@chromium.org>, public-webapps@w3.org
Message-ID: <op.vlb9u4mf64w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 26 Oct 2010 23:06:08 +0200, Cameron McCormack <cam@mcc.id.au>  
wrote:
> Anne van Kesteren:
>> Yeah, it would be nice if sequence mapped to that so that NodeList
>> could be defined as a sequence instead, same for StyleSheetList,
>> etc. And then Web IDL would take care of all the details rather than
>> each specification.
>
> I don’t know that sequence is appropriate for this.  They are meant to
> be for pass-by-value lists.

I'm not sure I follow this. Could you elaborate a bit?


> Is the issue here that you can’t use a base interface because then you
> would lose some type specificity, e.g.
>
>   interface Collection {
>     attribute unsigned long length;
>     getter any item(unsigned long index);
>   }
>
> where you need to use “any” because you don’t know what the type of the
> derived interface elements will be?

Well, and you would need to define that base interface somewhere and all  
other specifications would need to use it. But I thought this was the  
point of sequence. I have been using it that way in the CSSOM at least to  
replace all these dreaded SomethingList interfaces/objects. Maybe we  
should introduce something else for it?


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Friday, 29 October 2010 13:18:22 GMT

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