Re: [selectors-api] What DOM feature "Selectors API" belongs to?

Anne van Kesteren:
> Indeed. In another thread I requested functionality to be added to DOM  
> Bindings so you could indicate whether the interface is exposed or not

That one was added.

> or way to define what the "base" interface it is which has the same
> effect but might be cleaner as it also removes the need to say
> "objects implementing interface X must also implement interface XY".

I didn’t add that one.  Recently I implemented some DOM interfaces,
including the multiple inheritance, using WebKit’s JSCore.  It needed a
bit of hackery (since the public JSCore API is only designed for single
inheritance) but it worked in the end.  That allowed user script to, for
example, do this:

  var f = EventTarget.prototype.addEventListener;
  var f2 = function(evt) { /* … */ };
  assert(EventTarget.prototype != Node.prototype);
  assert(typeof f == 'function');
  assert(typeof Node.prototype.addEventListener == 'undefined');
  assert(document.addEventListener == f);
  EventTarget.prototype.addEventListener = f2;
  assert(document.addEventListener == f2);

-- 
Cameron McCormack, http://mcc.id.au/
 xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

Received on Thursday, 14 February 2008 23:47:12 UTC