Re: How to get event listener method inheritance clarified

Christopher M. Balz:
> Thank you for the reply! I agree - I don't know IDL but it looks like
> the spec enables this via the mixin prototype object in the 'Node'
> object diagram.

Correct.

> Perhaps this could use some additional explanation
> (http://dev.w3.org/2006/webapi/WebIDL/#PrototypeRoot  and scroll down) -
> 
> "Editorial note   Maybe the functions on mixin prototype objects
> should just call the relevant function on the original interface’s
> prototype object."
> 
> Since interfaces don't have implementations of methods, what would the
> Editorial note's suggestion do?

The interface at the IDL level doesn’t have an implementation, but in
the ECMAScript environment there are implementations of these
interfaces.  The terminology used in the spec is that, for example,
Node.prototype is a reference to the “interface prototype object”.  So
the editorial note is suggesting that functions on a mixin prototype
object (like Node’s mixin prototype object’s addEventListener) simply
call the corresponding function on the original interface’s prototype
object (EventTarget.prototype.addEventListener).

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

Received on Sunday, 20 September 2009 22:41:47 UTC