[whatwg] .tags on HTMLCollections

Jonas Sicking jonas at sicking.cc
Fri Aug 7 16:20:18 PDT 2009


On Tue, Jul 28, 2009 at 2:48 PM, Ian Hickson<ian at hixie.ch> wrote:
> On Mon, 13 Jul 2009, Boris Zbarsky wrote:
>>
>> Ian just pointed out to me that his current draft requires
>> HTMLCollections to implement a tags() method (which seems to do a filter
>> by tagName on the contents of the collection).
>>
>> As far as I can tell, IE, Webkit, and Opera implement this; Gecko does
>> not.  I was wondering whether any of the Webkit or Opera folks could
>> comment on _why_ they implement this?  I haven't seen any uses of this
>> in the wild (outside document.all.tags, but document.all doesn't behave
>> like a normal HTMLCollection in all sorts of other ways either).
>>
>> I'd rather be specifying (and implementing) a smaller DOM API, if that's
>> all that's needed for actual web compat....
>
> On Tue, 14 Jul 2009, Maciej Stachowiak wrote:
>>
>> Support for HTMLCollection.tags() in WebKit predates the fork from
>> KHTML. So we don't know why it was originally added.
>
> On Tue, 14 Jul 2009, Boris Zbarsky wrote:
>>
>> I guess the other question is whether you feel it's worth keeping...
>
> On Tue, 14 Jul 2009, Maciej Stachowiak wrote:
>>
>> I don't know of a reason it's needed for collections other than
>> document.all. But it also doesn't seem harmful and I can't say
>> definitively whether it helps anything. I wouldn't object to removing it
>> from the spec, but we probably wouldn't remove it from WebKit short of
>> evidence that it's actually harmful.
>>
>> Perhaps Opera people can shed more light on the matter.
>
> On Thu, 23 Jul 2009, Anne van Kesteren wrote:
>>
>> From what I heard so far it is there because of document.all. If
>> document.all does indeed need to return a separate object as HTML5
>> suggests we can probably remove it from HTMLCollection in due course.
>
> I haven't removed HTMLCollection.tags yet, since it appears to be
> implemented by most browsers. If we can get Opera and WebKit to remove
> support, then I'll remove it from the spec.

Given that we have some data indicating that .tags() is not needed for
web compatibility (Firefox doesn't support it and has received no
requests for it, or bugs indicating sites needing it), and so far only
weak data indicating it is needed (UAs support it, but not clear why),
why not leave it out of the spec for now?

UAs are always free to continue supporting it if they so please.

I have very little desire to add support for anything to gecko "just
in case", without any data indicating anyone would use it, much less
needs it.

/ Jonas



More information about the whatwg mailing list