another patch for bug #65777. This one removes the intermediate window that is created for mailto:// URLs that are explicitly target to a new window...

This commit is contained in:
rpotts@netscape.com
2001-05-21 06:50:51 +00:00
parent 2ab720b697
commit 4687b9bd5d

View File

@@ -3752,9 +3752,46 @@ nsDocShell::InternalLoad(nsIURI * aURI,
aHeadersData,
aLoadType,
aSHEntry);
return rv;
if (rv == NS_ERROR_NO_CONTENT) {
if (bIsNewWindow) {
//
// At this point, a new window has been created, but the
// URI did not have any data associated with it...
//
// So, the best we can do, is to tear down the new window
// that was just created!
//
nsCOMPtr<nsIDocShellTreeItem> treeItem;
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
treeItem = do_QueryInterface(targetDocShell);
treeItem->GetTreeOwner(getter_AddRefs(treeOwner));
if (treeOwner) {
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin;
treeOwnerAsWin = do_QueryInterface(treeOwner);
if (treeOwnerAsWin) {
treeOwnerAsWin->Destroy();
}
}
}
//
// NS_ERROR_NO_CONTENT should not be returned to the
// caller... This is an internal error code indicating that
// the URI had no data associated with it - probably a
// helper-app style protocol (ie. mailto://)
//
rv = NS_OK;
}
else if (bIsNewWindow) {
// XXX: Once new windows are created hidden, the new
// window will need to be made visible... For now,
// do nothing.
}
}
return rv;
}