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

Re: ACTION-87: Selectors API

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 6 Mar 2006 20:33:37 +0000 (UTC)
To: Cameron McCormack <cam@mcc.id.au>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <Pine.LNX.4.62.0603062031170.315@dhalsim.dreamhost.com>

On Sun, 26 Feb 2006, Cameron McCormack wrote:
>
> Ian Hickson:
> > * Having an interface doesn't imply behaviour -- e.g. NodeList doesn't 
> > imply that NodeList is live. You can have an object that implemnets 
> > NodeList and is not live.
> 
> Except that DOM 3 says:
> 
>   The NodeList interface provides the abstraction of an ordered
>   collection of nodes, without defining or constraining how this
>   collection is implemented. NodeList objects in the DOM are live.
> 
> and I'd say that NodeList objects returned by a getElementsBySelector() 
> would be "in the DOM".

The solution is just saying this is an exception to the general rule, not 
inventing a duplicate interface.


> > * I would recommend against supporting namespaces in the first 
> > version, for simplicity.
> 
> I think it is important for anything other than plain HTML, especially 
> CDF, to support namespaces from the outset.

That isn't clear to me. In practice, namespaced selectors aren't used that 
much at all.


> > * I would recommend having getElementsBySelector and 
> > getElementsBySelectorNS if you wanted to support both, rather than 
> > using optional arguments. Some languages don't support method 
> > overloading on argument signatures and would need different numbers of 
> > arguments anyway.
> 
> What would happen if you called getElementsBySelector with a selector 
> that included a namespace?

It would raise an exception, as the spec already says.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 6 March 2006 20:33:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:53 GMT