Re: [selectors-api] Why null as opposed to empty string (or either one) to resolve default namespace

On Jul 12, 2008, at 12:20 AM, Bjoern Hoehrmann wrote:

>> For what it's worth, it looks to me like Gecko returns the default
>> namespace if "" is passed to lookupNamespaceURI.  It's not clear to  
>> me
>> whether that's correct per the DOM3 Core spec.
>
> It is, because it requires that for `null`, and requires to treat  
> empty
> strings the same as `null` whenever namespace names are specified.


WebKit returns null if "" is passed to lookupNamespaceURI. I was going  
to fix it, but could not find any reference to this behavior in DOM 3  
Core. The closest thing I found was "In programming languages where  
empty strings can be differentiated from null, empty strings, when  
given as a namespace URI, are converted to null" - but the parameter  
to lookupNamespaceURI is not a namespace URI.

So, it seems to me that WebKit behavior is correct by the letter of  
the spec.

- WBR, Alexey Proskuryakov

Received on Monday, 14 July 2008 07:38:51 UTC