Boris Zbarsky wrote:
Lachlan Hunt wrote:
That's in the Bindings4Dom spec. I'm trying to make the IDL conform
to it.
http://dev.w3.org/2006/webapi/Binding4DOM/#NoNull
So the relevant part of that spec is:
How implementations treat the assignment of a null value to an
attribute with the [NoNull] extended attribute, or passing a null
value as a [NoNull] operation argument, is specific to the language
binding.
The example indicates that in ECMAScript passing null as a DOMString
just passes the string "null". What is the benefit of this behavior
over treating null as the empty string, which is what I presume happens
if the [NoNull] is not specified?
What do existing implementations do here?
Tested using this code:
try {
var x = document.querySelector(null);
alert("x = " + x);
} catch(e) {
alert(e);
}
and similarly for querySelectorAll(null);
WebKit: Throws SYNTAX_ERR for both
IE 8 Beta: Returns null or empty NodeList
Opera: Returns null or empty NodeList
--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/