Re: Prototype chain for objects that implement multiple interfaces

2007-06-08 Thread Boris Zbarsky
liorean wrote: Is this the reason for: var div=document.createElement('div'), span=document.createElement('span'), text=document.createTextNode('What am I?'); Function.prototype.call.call(div.appendChild,span,text); text.data+='\r\n'+text.parentNode.tagName; faili

Re: Prototype chain for objects that implement multiple interfaces

2007-06-08 Thread Boris Zbarsky
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.ap

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread Boris Zbarsky
Maciej Stachowiak wrote: I'm not even sure if it's intentional that global constructors in Mozilla have a function-valued property named "QueryInterface", or just an implementation artifact. It's an implementation artifact. -Boris

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread liorean
liorean: > (The ECMAScript built-in constructors all follow the pattern of having > [[Call]], so their [[Class]] is "Function" instead and their > [[Prototype]] is the initial Function.prototype. The DOM constructors > don't have [[Call]] so their [[Class]] should be "Object" instead. Or > some

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread Cameron McCormack
Cameron McCormack: > > NodeList = { an object } > > NodeList.[[Prototype]] = Object prototype object > > NodeList.prototype = { an object } > > NodeList.prototype.[[Prototype]] = Object prototype object > > NodeList.prototype.constructor = NodeList > > NodeList.prototype.someFunction = { som

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread liorean
Cameron McCormack wrote: > This is probably not what browsers do in practice, though. For example, > Opera 9 has an addEventListener method directly on the Node interface > prototype object On 06/06/07, Boris Zbarsky <[EMAIL PROTECTED]> wrote: What Gecko does is to put all properties for al

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread liorean
On 06/06/07, Cameron McCormack <[EMAIL PROTECTED]> wrote: What should the prototype chain for an object that implements multiple interfaces looks like? A single interface is simple enough: NodeList = { an object } NodeList.[[Prototype]] = Object prototype object NodeList.prototype = { an

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread Maciej Stachowiak
On Jun 5, 2007, at 10:52 PM, Ian Hickson wrote: On Wed, 6 Jun 2007, Boris Zbarsky wrote: To be honest, do we really think that specifying the exact prototype chain is desirable? How likely are UAs to rework the mappings between their native code and ECMAScript to follow said spec? Saf

Re: Prototype chain for objects that implement multiple interfaces

2007-06-06 Thread Maciej Stachowiak
On Jun 5, 2007, at 10:15 PM, Boris Zbarsky wrote: Cameron McCormack wrote: This is probably not what browsers do in practice, though. For example, Opera 9 has an addEventListener method directly on the Node interface prototype object What Gecko does is to put all properties for all the

Re: Prototype chain for objects that implement multiple interfaces

2007-06-05 Thread Ian Hickson
On Wed, 6 Jun 2007, Boris Zbarsky wrote: > > To be honest, do we really think that specifying the exact prototype > chain is desirable? How likely are UAs to rework the mappings between > their native code and ECMAScript to follow said spec? Safari has had to implement this stuff in a Mozilla

Re: Prototype chain for objects that implement multiple interfaces

2007-06-05 Thread Cameron McCormack
Boris Zbarsky: > As a result, given a object (call it "div"), > > div.[[Prototype]] === HTMLDivElement.prototype > HTMLDivElement.prototype.[[Prototype]] === HTMLElement.prototype > div.appendChild === HTMLDivElement.prototype.appendChild > > are all true, while > > div.appendChild ===

Re: Prototype chain for objects that implement multiple interfaces

2007-06-05 Thread Boris Zbarsky
Cameron McCormack wrote: This is probably not what browsers do in practice, though. For example, Opera 9 has an addEventListener method directly on the Node interface prototype object What Gecko does is to put all properties for all the interfaces an object implements onto the "closest" prot

Re: Prototype chain for objects that implement multiple interfaces

2007-06-05 Thread Cameron McCormack
Cameron McCormack: > The same question could apply to multiple inheritance (which is allowed > by OMG IDL, but AFAIK is not used in any of the DOM specs). As Ian reminds me, SVG uses multiple inheritance extensively. -- Cameron McCormack, http://mcc.id.au/ xmpp:[EMAIL PROTECTED] ▪ ICQ

Prototype chain for objects that implement multiple interfaces

2007-06-05 Thread Cameron McCormack
Hi everyone. What should the prototype chain for an object that implements multiple interfaces looks like? A single interface is simple enough: NodeList = { an object } NodeList.[[Prototype]] = Object prototype object NodeList.prototype = { an object } NodeList.prototype.[[Prototype]] =