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.

git-svn-id: svn://10.0.0.236/trunk@42377 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com
1999-08-05 23:59:00 +00:00
parent 3cd674a91c
commit 06c8af2df1

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