Re: [whatwg] WebIDL and HTML5

Garrett Smith wrote:
> window.open();

Which should be equivalent to window.open(undefined) (and isn't in some 
UAs), right?

What should window.open(null) do?

> If the first argument is null or undefined or the empty string, no uri
> is loaded and an blank/empty window is displayed.

This is not the case in Firefox, Opera, or Safari.  Safari and Firefox 
treat null as "null".  Opera treats it as "".  Opera treats undefined as 
"", while Safari and Firefox treat it as "undefined".

This is for window.open's first argument.

> There seems to be no mapping though Ian has requested documenting such mapping.

No mapping of what?  ""+null is "null".  ""+undefined is "undefined". 
Those are basically what Firefox and Safari do.  That doesn't seem like 
the right thing to do here, necessarily.

> Are there other examples for "if the argument is null or undefined..."?

Sure.  A lot of the namespace-relatd DOM methods, as well as all sorts 
of DOM0 stuff.

> There are probably others but I can't think of them. I think the
> majority of the time that strings will want to go to ToString,
> booleans will want to go to ToBoolean.

That can be the default, perhaps.  But I suspect usually null should 
become "", not "null".

-Boris

Received on Monday, 25 August 2008 18:29:06 UTC