mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
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:
parent
3a03b5d8cc
commit
8076891e81
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user