W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2012

Re: TPAC F2F DOM2 Selectors API review

From: Allen Wirfs-Brock <allen@wirfs-brock.com>
Date: Tue, 30 Oct 2012 08:47:21 -0700
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, Erik Aarvidson <arv@google.com>, odinho@opera.com, Yehuda Katz <wycats@gmail.com>, Mark Miller <erights@google.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-Id: <1BDE8D1C-2BB9-4488-A869-6BB36915AF84@wirfs-brock.com>
To: Alex Russell <slightlyoff@google.com>

On Oct 30, 2012, at 2:36 AM, Alex Russell wrote:

> Hi Everyone,
> 
> So today at TPAC there was a brief discussion about Selectors 2 -- and good news, everybody! We've settled on "find", "findAll", and "matches"!
> 
> The return type is still the issue, however, and I proposed the following today:
> 
> We specify the DOM APIs which vend node lists which must be immutable or mutated only by DOM (a.k.a. "live node lists") from existing APIs as either seal()/freeze() instances or as Proxies. That allows the vending APIs to maintain the invariants regardless of what NodeList as a class does
> We define NodeList as a constructable class which derives from Array, is mutable by default, etc.
In ES6 terms, do you mean:

class NodeList extends Array {
    constructor (...args) {
         super(...args);  //or maybe without ...args if NodeList constructor has a different  parameter interpretation
         // NodeList specific initialization such as  creating a proxy for this
      }
      //other NodeList specific methods and over-rides
}

With the assumption that "subclassing" Array and super invoking its constructor installs all Array magic such as length property invariants on the subclass instance.

Allen
Received on Tuesday, 30 October 2012 15:48:05 UTC

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