Re: [selectors-api] How to invoke lookupNamespaceURI?

Jonas Sicking wrote:
> Bjoern Hoehrmann wrote:
>> * Anne van Kesteren wrote:
>>> The latest version of the draft (1.14) assumes (in an example) that 
>>> you take prefixes from left to right...
>>
>>   x|y:empty > a|b
>>
>> ... In short, defining this would expose implementations details for 
>> no good reason.
> 
> I would say that the same holds true for "must not call the resolver 
> more than once" though. Since the proposed solution doesn't give 
> deterministic behavior for any given NSResolver anyway, why not simply 
> say that behavior in this case too is undefined.

I do not think it's wise to explicitly introduce undefined behaviour 
where it is not necessary.  Although this requirement doesn't make the 
NSResolver behaviour any more predictable for the UA, it makes the UA's 
behaviour marginally more predictable for the author.

> I.e. the behavior of the following NSResolver
> 
> var N = 0;
> function resolver(prefix) {
>   return ['http://myns1.org', 'http://myns2.org][N++];
> }
> 
> is undefined for "x|y:empty > a|b", so why couldn't it be for
> "x|y:empty > x|b".

Making that undefined creates a situation where, for example, the 
resolver could be called twice with the same prefix and gets different 
return values.  That creates more problems than it solves.

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

Received on Saturday, 21 April 2007 01:59:06 UTC