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

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 13 Jul 2012 13:01:55 -0700
Message-ID: <CABNRm63_XehbDnvNm-SUSnBFCj5KhP8f2r5VXDZpE16Hofruqg@mail.gmail.com>
To: "<whatwg@whatwg.org>" <whatwg@whatwg.org>
According to
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlpropertiescollection

*HTMLCollection* returns the first element.
*HTMLAllCollection* returns the first element or another HTMLAllCollection
if there are multiple elements
*HTMLFormControlsCollection* returns the first element or RadioNodeList if
there are multiple elements
*HTMLOptionsCollection* returns the first element or live NodeList if there
are multiple elements
*HTMLPropertiesCollection* returns PropertyNodeList

In particular, I'm puzzled that
HTMLAllCollection, HTMLFormControlsCollection, and HTMLOptionsCollection
all return different objects. Why?

Can those 3 classes somehow return the same object? FWIW, WebKit has always
returned a static node list.

Best,
Ryosuke Niwa
Software Engineer
Google Inc.
Received on Friday, 13 July 2012 20:02:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:09 GMT