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

On 1/23/12 12:01 PM, Jonas Sicking wrote:
> On Mon, Jan 16, 2012 at 10:24 PM, Boris Zbarsky<bzbarsky@mit.edu>  wrote:
>> The cons I see are:
>>
>> 1)  More work for WebKit, which was arguably just following the spec.
>> 2)  Existing code that only decorates NodeList.prototype but not
>> HTMLCollection.prototype with something would no longer work for these
>> return values in WebKit or Presto (it already doesn't work in Trident or
>> Gecko).  It's possible that we could ameliorate this by making
>> HTMLCollection inherit from NodeList, I guess.
>
> Does HTMLCollection also have the fairly ugly 'named getter' behavior?

Yes, it does.  The return value of getElementsByTagName has that 
behavior in all browsers, including in WebKit-based browsers where it 
claims to be a NodeList.  See my followup in this post.

-Boris

Received on Monday, 23 January 2012 14:24:48 UTC