Fixing bug 101492. Making self.close() do nothing when called from within a frame in a frameset (or from an iframe) for backwards compatibility. r=peterv@netscape.com, sr=brendan@mozilla.org

git-svn-id: svn://10.0.0.236/trunk@105530 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%netscape.com 2001-10-16 21:19:05 +00:00
parent ff4273d2c4
commit 1219d2d2b7

View File

@ -2416,6 +2416,16 @@ GlobalWindowImpl::GetFrames(nsIDOMWindow** aFrames)
NS_IMETHODIMP
GlobalWindowImpl::Close()
{
nsCOMPtr<nsIDOMWindow> parent;
GetParent(getter_AddRefs(parent));
if (parent != NS_STATIC_CAST(nsIDOMWindow *, this)) {
// window.close() is called on a frame in a frameset, such calls
// are ignored.
return NS_OK;
}
// Note: the basic security check, rejecting windows not opened through JS,
// has been removed. This was approved long ago by ...you're going to call me
// on this, aren't you... well it was. And anyway, a better means is coming.