W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

[selectors-api] Return an Array instead of a static NodeList

From: Julien Richard-Foy <julien@richard-foy.fr>
Date: Sun, 21 Aug 2011 19:52:25 +0200
To: public-webapps@w3.org
Message-Id: <201108211952.25761.julien@richard-foy.fr>
Since Javascript 1.6, a lot of useful collection functions are defined for 
Array [1]. Unfortunately, they can’t be used directly with results returned by 
.querySelectorAll, or even .getElementsByTagName since these functions return 
I understand the DOM API is defined without a language in mind, but these 
collection functions are really useful, easy to implement and already 
available in most mainstream languages. Therefore, why not create a base 
Traversable type which would be implemented by all collection types (like 
NodeList) and which would provide the so useful bunch of iteration methods? 
Are there some issues or drawbacks I did not think of?


Received on Wednesday, 24 August 2011 05:37:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:23 UTC