hook up _parent target in window.open. it wasn't. bug 168807 code=keeda@hotpop.com r=jkeiser,jst,me

This commit is contained in:
danm%netscape.com 2002-11-12 19:05:17 +00:00
Родитель 845fb647ed
Коммит 9e5297c92c
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -20,7 +20,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* * Harshal Pradhan <keeda@hotpop.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -532,6 +532,14 @@ nsWindowWatcher::OpenWindowJS(nsIDOMWindow *aParent,
GetWindowTreeItem(aParent, getter_AddRefs(shelltree)); GetWindowTreeItem(aParent, getter_AddRefs(shelltree));
if (shelltree) if (shelltree)
shelltree->GetSameTypeRootTreeItem(getter_AddRefs(newDocShellItem)); shelltree->GetSameTypeRootTreeItem(getter_AddRefs(newDocShellItem));
} else if (name.EqualsIgnoreCase("_parent")) {
nsCOMPtr<nsIDocShellTreeItem> shelltree;
GetWindowTreeItem(aParent, getter_AddRefs(shelltree));
if (shelltree)
shelltree->GetSameTypeParent(getter_AddRefs(newDocShellItem));
// If there is no real parent then _self acts as _parent
if (!newDocShellItem)
newDocShellItem = shelltree;
} else { } else {
/* parent is being simultaneously torn down (probably because of /* parent is being simultaneously torn down (probably because of
the code that keeps an old docshell alive but disconnected while the code that keeps an old docshell alive but disconnected while