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

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

From: Anne van Kesteren <annevk@opera.com>
Date: Wed, 12 Mar 2008 13:55:53 +0100
To: "Boris Zbarsky" <bzbarsky@mit.edu>, "Web APIs WG" <public-webapi@w3.org>
Message-ID: <op.t7wl7fun64w2qv@annevk-t60.oslo.opera.com>

On Wed, 12 Mar 2008 04:08:30 +0100, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
> Is there a reason to have identical interfaces called DocumentSelector  
> and ElementSelector that are identical?  Would it not make sense to just  
> define a NodeSelector or something and require Document and Element  
> nodes to implement it?  The confromance requirement could be easily  
> stated in terms of descendants of the Node in question in a way that  
> would work for both Document and Element nodes...

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.)


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Wednesday, 12 March 2008 12:56:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 12 March 2008 12:56:05 GMT