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

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 13 Jul 2012 15:23:39 -0700
Message-ID: <CABNRm616p8XLC090ZaX0uUB+oyzphQrDioxqgEpEA-KE0ohjnw@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: "<whatwg@whatwg.org>" <whatwg@whatwg.org>
On Fri, Jul 13, 2012 at 3:17 PM, Ian Hickson <ian@hixie.ch> wrote:

> On Fri, 13 Jul 2012, Ryosuke Niwa wrote:
> >
> > According to
> >
> http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlpropertiescollection
> >
> > *HTMLCollection* returns the first element.
>
> This is for compat in the default case, I believe.
>
>
> > *HTMLAllCollection* returns the first element or another
> HTMLAllCollection
> > if there are multiple elements
>
> This is needed for IE compat.
>

We can't use live NodeList or a regular HTMLCollection?

> *HTMLFormControlsCollection* returns the first element or RadioNodeList if
> > there are multiple elements
>
> This is needed to support the radio button value feature.
>
>
> > *HTMLOptionsCollection* returns the first element or live NodeList if
> there
> > are multiple elements
>
> This is for compat, I believe. (We don't want to return just a node if
> there are many matching.)
>

We can't return HTMLAllCollection or RadioNodeList here?

 > Can those 3 classes somehow return the same object? FWIW, WebKit has
> > always returned a static node list.
>
> WebKit doesn't support the microdata and radio button features,
> presumably, and is presumably less than perfectly compatible with the Web
> for the others. :-)
>

I'm not certain if we're willing to change our behavior to match the spec.
We haven't gotten any bug reports due to this behavior as far as I know,
and following the spec introduces a significant code complexity.

- Ryosuke
Received on Friday, 13 July 2012 22:24:28 GMT

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