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

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 UTC