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

[Element Traversal LC] access to element by index

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Fri, 28 Mar 2008 15:42:09 +0100
Message-ID: <47ED03C1.60303@disruptive-innovations.com>
To: "Web APIs WG (public)" <public-webapi@w3.org>

Hi,

1. congrats for this spec, I love it ; I can't count how many times in
    page or chrome script I am filtering out nodes that are not element
    nodes.

2. the ElementTraversal interface has a |childElementCount| attribute
    but misses access to an individual childElement based on its index.
    That would be really useful. Two solutions here :

    a. you remove the childElementCount attribute in favor of a

         readonly attribute NodeList    childElements;

       and that NodeList has all we need

    b. you add

         Node    item(in unsigned long index);

       but that is not really consistent with the existing way of
       querying list of nodes.

    My very strong preference goes to solution a.

Best,

</Daniel>
Received on Friday, 28 March 2008 14:42:43 GMT

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