W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2008

Re: [whatwg] WebIDL and HTML5

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 25 Aug 2008 14:28:18 -0400
Message-ID: <48B2F9C2.1080702@mit.edu>
To: Garrett Smith <dhtmlkitchen@gmail.com>
CC: Web Applications Working Group WG <public-webapps@w3.org>

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".

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

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:11 UTC