Fix for bug 298064 (nsContentUtils::GetDocumentFromCaller() is broken.). r=jst, sr=brendan.

git-svn-id: svn://10.0.0.236/trunk@179553 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2005-09-02 18:02:51 +00:00
parent 8c4e2f1dda
commit f5f85d2946
3 changed files with 17 additions and 14 deletions

View File

@@ -1850,15 +1850,14 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
// Grab a reference to the calling documents security info (if any)
// and principal as it may be lost in the call to Reset().
nsCOMPtr<nsISupports> securityInfo;
nsCOMPtr<nsIPrincipal> callerPrincipal;
if (callerDoc) {
securityInfo = callerDoc->GetSecurityInfo();
nsContentUtils::GetSecurityManager()->
GetSubjectPrincipal(getter_AddRefs(callerPrincipal));
}
nsCOMPtr<nsIPrincipal> callerPrincipal;
nsContentUtils::GetSecurityManager()->
GetSubjectPrincipal(getter_AddRefs(callerPrincipal));
// The URI for the document after this call. Get it from the calling
// principal (if available), or set it to "about:blank" if no
// principal is reachable.