don't name windows using reserved target names. bug 208862 r=jag,jst,mscott

git-svn-id: svn://10.0.0.236/trunk@143628 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com 2003-06-12 07:08:12 +00:00
parent d5a2470f0f
commit 30cbe64cc1

View File

@ -672,7 +672,12 @@ nsWindowWatcher::OpenWindowJS(nsIDOMWindow *aParent,
}
}
newDocShellItem->SetName(nameSpecified ? name.get() : nsnull);
/* allow an extant window to keep its name (important for cases like
_self where the given name is different (and invalid)). also _blank
is not a window name. */
if (windowIsNew)
newDocShellItem->SetName(nameSpecified && !name.EqualsIgnoreCase("_blank") ?
name.get() : nsnull);
nsCOMPtr<nsIDocShell> newDocShell(do_QueryInterface(newDocShellItem));