W3C home > Mailing lists > Public > public-webapi@w3.org > March 2008

Re: [Element Traversal LC] access to element by index

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 28 Mar 2008 12:41:56 -0500
Message-ID: <47ED2DE4.2070400@mit.edu>
To: Doug Schepers <schepers@w3.org>
CC: "Web APIs WG (public)" <public-webapi@w3.org>

Doug Schepers wrote:
>  Speaking as an author of many SVG Webapps and a contributor to several 
> SVG script libs, knowing the number of child elements is a really common 
> need; index-based access is less needed, and can be effected by other 
> means.

I would just like to point out, from my perspective as an implementor, 
that implementing this as a nodelist would have taken all of 15 minutes 
of programming time.  Implementing the specification as written, while 
having acceptable performance on traversal, will take a good bit more 
work, and either a lot more complexity or additional space used by every 
single Element in the DOM.

I realize that this is due to the fact that I'm working with an 
implementation that already has a generic NodeList implementation... 
Nevertheless, the issue is there.

I have the feeling that I already mentioned this in the past, so I 
assume it's been considered in making the decision that the 
linked-list-only API is the one to use, but I wanted to mention it in 
case I hadn't before.

-Boris


P.S.  Oddly enough, in typical DOM authoring authors use index-based of 
childNodes a _lot_ more than the linked-list accessors....  Has anyone 
looked into why?
Received on Friday, 28 March 2008 17:42:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 28 March 2008 17:42:41 GMT