RE: [selectors-api] What DOM feature "Selectors API" belongs to?

On Thu, 14 Feb 2008, Kartikaya Gupta wrote:
> 
> Is it just me, or does seem very wrong? That means I can claim every 
> piece of software in the world is buggy, because none of them implement 
> a spec I just made up.

They're buggy implementations of your spec, yes, if they do something that 
contradicts your spec. Of course, it's quite possible nobody cares about 
your spec. :-)


> I would consider a bug to be something doesn't match the spec IF it's 
> *supposed* to match the spec. If it doesn't claim to match the spec, 
> then you're right, that doesn't change the spec. It does, however, 
> change what should be considered bugs in the software and what shouldn't 
> (i.e. it's a feature, not a bug).

I think it would be difficult to argue that Webkit is not attempting to 
implement the Selectors API.


> I also agree with you in that the spec shouldn't care if implementations 
> have bugs. There may be bugs in the querySelector implementation, or 
> there may be bugs in the hasFeature implementation, or both. Making an 
> implementation bug-free is outside the scope of the specification. What 
> I think *is* inside the scope is to ensure that user-agents have some 
> unambiguous way to state whether or not they claim to implement the 
> specification. I think the feature string is much more reliable way to 
> do that than checking the existence of a "querySelector" method.

Why would any browser implementor implement one and not the other?


> If a user-agent decides to implement a "querySelector" method on the 
> Document interface that, say, provides a way to query some godlike 
> "Selector" creature in a galaxy far away, then there is absolutely *no* 
> way for an author to determine whether or not he can call 
> "querySelector" and expect to return a list of nodes or the meaning of 
> life.

What about if a user agent decides to implement a "hasFeature" method that 
provides a way to query some godlike "Feature" creature in a galaxy far 
away? How can we guarentee that hasFeature() is the right hasFeature() if 
we can't guarentee that querySelector() is the right querySelector()?


I think this is a highly theoretical concern and in practice hasFeature() 
is a waste of time and effort (and memory and CPU and bandwidth).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 14 February 2008 22:06:14 UTC