[whatwg] getElementsByClassName()

Jim Ley wrote:
> ...neither is it apparent that a classname specific shortname is 
> worthwhile when a CSSSelector one would be more appropriate.

It should be called getElementsBySelector, rather than CSSSelector, 
because selectors is not specific to CSS (it's not even called "CSS 
Selectors" any more).

One issue with a Selector method though, how do we handle namespace 
prefixes?  Selectors states that the mechanism for declaring a namespace 
prefix is left up to the language implementing Selectors.  If we say the 
script uses the same prefixes declared in the markup using xmlns:foo="", 
then that ties the JS to the document and other documents that use those 
same prefixes.  If we say it uses those declared in CSS with @namespace, 
then that ties the script to the CSS.  Would we need another method 
called addNamespace(namespaceURI, prefix)?

>> Ian has already indicated that the specification of a method to
>> collect DOM elements based on a CSS selector is best left to the CSS
>> WG.

I'd like to know why this is the case.  Defining a DOM method seems like 
it would be out of scope for the CSS working group and seems to be in 
the scope of the WHATWG.  Other than that, it could be left up the the 
DOM WG or possibly the Web API WG although it doesn't quite fit anything 
anything mentioned in their charter.

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Saturday, 4 February 2006 15:16:48 UTC