Re: [selectors-api] Use case for passing invalid selector

Simon Pieters wrote:
> On Mon, 08 Dec 2008 17:26:18 +0100, Lachlan Hunt 
> <lachlan.hunt@lachy.id.au> wrote:
> 
>>> == Section 6. The NodeSelector Interface
>>>
>>>>> The caller must pass a valid group of selectors.
>>>  That's an authoring requirement, explain how that is applicable?
>>
>> It seems perfectly applicable for the spec to define how the methods 
>> need to be used by conforming applications.  Please explain why you 
>> think it is not applicable?
> 
> Consider the custom pseudo-classes in http://docs.jquery.com/Selectors
> 
> It seems reasonable to me to just try the selector with the Selectors 
> API and catch the exception, instead of parsing the argument manually 
> making sure it's a valid group of selectors before passing it to the 
> Selectors API.

The whole point of including the statement is to define what valid input 
is permitted for the method to work without throwing an exception.  It 
doesn't prevent authors from passing invalid selectors anyway, and just 
because they may have a perfectly good reason to do so, doesn't make the 
input itself valid.

But do you have an alternative proposal for how to define it?

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Tuesday, 9 December 2008 11:25:32 UTC