Re: [Selectors API] Call for Consensus - approve John Resig's tests

Boris Zbarsky:
> > Ah, that wasn't the case last I checked.  And again, there's no 
> > specification I can find that requires it.

Ian Hickson:
> WebIDL defines the class name and ECMAScript requires the [object foo] 
> serialisation, if I'm not mistaken.
> 
> If I'm wrong and it's not required yet, then I guess I have a bug report 
> for heycam. :-)

You can require a certain [[Class]] value at the moment with Web IDL, if
you use the [PrototypeRoot] extended attribute.

  If the host object implements an interface that has the
  [PrototypeRoot] extended attribute, then the interface the host
  object implements that has the largest prototype ancestor set is
  deemed to be the primary prototype interface of the host object.
  …
  If a host object has a primary prototype interface, then the value of
  the internal [[Class]] property MUST be the identifier of that
  interface. Otherwise, if the host object has no primary prototype
  interface, the value of the internal [[Class]] property is
  implementation specific. 
   — http://www.w3.org/TR/WebIDL/#host-objects

However, since there’s no Web IDL definition of NodeList that uses
[PrototypeRoot], there is no requirement on the value of [[Class]] of
the object returned by querySelectorAll().

(We could define that if a host object implements only a single
interface, then [[Class]] must be the identifier of that interface.  The
requirements on particular values for host object [[Prototype]] is still
somewhat speculative, and will probably change a bit more.)

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Saturday, 7 March 2009 03:10:09 UTC