W3C home > Mailing lists > Public > public-webapi@w3.org > June 2007

Re: Prototype chain for objects that implement multiple interfaces

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 08 Jun 2007 16:21:13 -0500
Message-ID: <4669C849.3010908@mit.edu>
To: public-webapi@w3.org

Cameron McCormack wrote:
> I wondered that myself, but it would help the case where script authors
> want to mess about with the prototypes of various objects.  Perhaps it
> doesn’t need to be specified exactly, but with enough fixed down such
> that you could reliably assign to HTMLElement.prototype.appendChild and
> expect it to affect your div element.

Agreed.  The fact that it doesn't in Gecko is not exactly desirable, and is not 
a purposeful decision; it's a side-effect of how the general system for 
reflecting C++ into ECMAScript handles multiple interfaces implemented on a 
single ECMA object.

>  How about for Mozilla,
> assuming something “sensible” was specified that allowed script authors
> to know in which prototype object methods from a particular interface
> are to be found so that they can overwrite them?

Basically, the only way this would change in Mozilla is if Mozilla completely 
changes how C++ objects are reflected into ECMAScript for DOM objects.

On the bright side, there are plans to do just that in the next several years, 
so I'd say that there's a good chance that a sensible spec here would get 
implemented in Gecko.  I can't commit to that on my own, though.  I'll ask the 
folks who might be able to to chime in.

Received on Friday, 8 June 2007 21:21:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:09:56 UTC