Re: [selectors-api] Extended Attribute [NoNull] in the IDL

On May 2, 2008, at 7:37 PM, Cameron McCormack wrote:

>
> Boris Zbarsky:
>> In that case, the null behavior doesn't make any sense to me...  I  
>> would
>> expect querySelector(null) to either behave as  
>> querySelector("null") (as
>> in Opera) or as querySelector("") (as in Gecko and apparently  
>> Webkit)...
>
> If there’s a need for null to stringify to "", then I can add another
> extended attribute to Web IDL.

It needs to for many standard DOM methods. Most core DOM methods that  
take namespaces treat a null namespaceURI or prefix parameter the same  
as the empty string, not the same as the string "null". As mentioned,  
I advise looking at WebKit's IDL files since we have represented most  
of the weird cases there. I think the empty string conversion may  
actually be somewhat more common in DOM APIs, although it is not the  
native ECMAScript string conversion behavior.

Regards,
Maciej

Received on Saturday, 3 May 2008 02:55:47 UTC