W3C home > Mailing lists > Public > public-webapi@w3.org > March 2008

Re: [selectors-api] Why have two identical differently named interfaces?

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 12 Mar 2008 16:47:57 -0700
Message-ID: <47D86BAD.9010406@sicking.cc>
To: Simon Pieters <simonp@opera.com>
CC: Boris Zbarsky <bzbarsky@mit.edu>, Anne van Kesteren <annevk@opera.com>, Web APIs WG <public-webapi@w3.org>

Simon Pieters wrote:
> 
> On Wed, 12 Mar 2008 16:27:50 +0100, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> 
>>
>> Anne van Kesteren wrote:
>>> The reason for two interfaces is to allow extensions to either going 
>>> forward. Though presumably for ECMAScript you can implement them 
>>> however you'd like as window.ElementSelector and 
>>> window.DocumentSelector should probably not exist. (Just prototype 
>>> Element/Document instead.)
>>
>> Making them not exist is quite a bit of pain in Gecko, for what it's 
>> worth.
>>
>> I guess I could do the two interfaces, but I'm having a hard time 
>> seeing different extensions being made to these two interfaces (as 
>> opposed to wholly new interfaces being invented, as was done here).
> 
> I don't have any opinion about how many interfaces there are or what 
> they are called, but I just wanted to point out that if there's one 
> interface then extensions for either elements or documents can still be 
> made by making a new interface that inherits from the common interface 
> when such an extension is needed (compare with e.g. HTMLMediaElement in 
> HTML5).

Yeah, i think this is the way to go.

/ Jonas
Received on Wednesday, 12 March 2008 23:48:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 12 March 2008 23:48:36 GMT