W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2012

Re: [dom] Should the return values of getElementsByClassName/TagName/TagNameNS be HTMLCollection

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 18 Feb 2012 18:23:17 -0500
Message-ID: <CA+c2ei_M7c8x-6dv0Ojod3B+VUseQdiNZUHckMNvDRpaf4FPrA@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, Ryosuke Niwa <rniwa@webkit.org>, www-dom@w3.org
On Sat, Feb 18, 2012 at 12:48 PM, Anne van Kesteren <annevk@opera.com> wrote:
> On Sat, 18 Feb 2012 18:12:06 +0100, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>> On 2/18/12 3:28 AM, Anne van Kesteren wrote:
>>> Named getters are nice for authors, and besides, it was already pointed
>>> out it's not avoidable here:
>>> http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0008.html
>> That's true, but Jonas raises a good point: we should certainly not add a
>> named getter to .childNodes, say.
> Well childNodes as you pointed out is a collection of nodes, not a
> collection of elements. I'm not sure it makes sense to expose element
> collections in wildly different ways, unless we want to discourage
> particular accessors.

Exposing it on more collections than needed will make it much harder
to deprecate the named getter. Until someone has measured (which I
believe both mozilla and google has the ability to do these days) I
think it's too early to say that we can't deprecate.

For example I'd hate it if we add named getters to the return value of
.querySelectorAll or .findAll.

/ Jonas
Received on Saturday, 18 February 2012 23:24:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:18 UTC