W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] Why do HTML*Collection's nameItem need to return 5 different objects?

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 6 Sep 2012 08:34:53 -0700
Message-ID: <CANMdWTvUnqr9weOa83P6HRoQ_WVfNQ-ExKU3AADFAJS8g2J=Cg@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: Ryosuke Niwa <rniwa@webkit.org>, "<whatwg@whatwg.org>" <whatwg@whatwg.org>
On Wed, Sep 5, 2012 at 1:47 PM, Ian Hickson <ian@hixie.ch> wrote:

> For HTMLOptionsElement, the situation is more murky.
>
>    http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1739
>
> From what I can tell, IE doesn't do direct named access, you have to do it
> via item() or namedItem(). The spec didn't support item() access for
> names, though all the browsers did. I've filed a bug on DOM Core for that.
> Using namedItem(), you see that IE returns a live HTMLCollection, the spec
> returns a live NodeList, WebKit returns a static NodeList, and Opera and
> Firefox return just the first option. (There's a note in the spec asking
> if we should switch to HTMLCollection rather than NodeList.)


I haven't followed the details closely enough to know which APIs should be
returning which types of lists/collections. As a general point though,
anywhere we can avoid live NodeLists/Collections is a big improvement. They
impose a significant implementation cost both in terms of complexity and in
terms of performance impact.
Received on Thursday, 6 September 2012 15:35:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC