attempts to find webshells with a null name now always fail. makes window.open() with null name open new window. seems not to break anything. you know who to beat up if it does.

This commit is contained in:
danm%netscape.com 1999-08-05 23:59:00 +00:00
parent 3a03b5d8cc
commit 8076891e81

View File

@ -1556,20 +1556,31 @@ nsWebShellWindow::NewWebShell(PRUint32 aChromeMask, PRBool aVisible,
return rv;
}
/**
* FindWebShellWithName - recursively search for any open window
* containing a webshell with the given name.
* @param aName - the name of the webshell to find. I believe this cannot
* be null. Hard to tell. If zero-length, the find will
* always fail (returning NS_OK).
* @param aResult - the webshell, returned, addrefed. null on failure to
* locate the desired webshell.
* @return an error indication. Can be NS_OK even if no match was found.
*/
NS_IMETHODIMP nsWebShellWindow::FindWebShellWithName(const PRUnichar* aName,
nsIWebShell*& aResult)
{
nsresult rv = NS_OK;
nsString nameStr(aName);
// first, a special case
if (nameStr.EqualsIgnoreCase("_content"))
return GetContentWebShell(&aResult);
// Zero result (in case we fail).
aResult = nsnull;
// first, special cases
if (nameStr.Length() == 0)
return NS_OK;
if (nameStr.EqualsIgnoreCase("_content"))
return GetContentWebShell(&aResult);
// look for open windows with the given name
/* Note: this function arguably works as expected, but the end effect
is wrong. The webshell that catches the name given from a JavaScript