W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

Re: indexed properties on NodeLists and HTMLCollections

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 14 Jun 2011 00:24:44 -0700
Message-ID: <BANLkTinvZpG+bUh-0oNTAYbFMUdT1VT6Rw@mail.gmail.com>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>, public-script-coord@w3.org, bzbarsky@mit.edu
On Mon, Jun 13, 2011 at 8:13 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> Cameron McCormack:
>> I would like to hear from implementors whether they
>>
>> † 1. are happy treating indexed properties as a layer above the normal
>> † † †object property resolution (like Chrome/Safari do);
>> † 2. think disallowing user defined non-configurable array index
>> † † †properties, or disallowing all user defined array index properties,
>> † † †as own properties on NodeLists/HTMLCollections is a good idea.
>
> Hearing some support for the above and no objections, I will start
> speccing this. †This will involve editorial work specifying the
> behaviour of [[Get]], etc. on these objects, rather than having it
> written in terms of defining and deleting properties at particular
> times.

I'd really like to hear from bz what he thinks will get the best
performance in Gecko. And from other browser vendors what will give
the best performance in their engines.

Personally I think it makes things the most consistent with JS if
these properties appear as properties on the object itself as that
avoids using magic catch-all getters/setters on the proto chain. But
if that has bad performance characteristics then that's obviously a
downside.

> I would prefer to go the route of disallowing all user defined array
> index properties on objects with indexed properties, as that is simpler.

I agree.

> Iím yet to do any testing for named properties. †There are two
> interfaces that have [OverrideBuiltins], HTMLDocument and
> HTMLFormElement, and Iím guessing that disallowing all user defined
> properties on objects with [OverrideBuiltins] named properties is not
> feasible.

Unfortunately that is probably the case.

/ Jonas
Received on Tuesday, 14 June 2011 07:25:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:03 UTC