backing out due to test failures

git-svn-id: svn://10.0.0.236/trunk@240229 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jonas%sicking.cc
2007-12-01 18:56:00 +00:00
parent bb36a7b116
commit 4a95bb78e2
3 changed files with 19 additions and 2 deletions

View File

@@ -2060,8 +2060,18 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
return NS_OK;
}
NS_ASSERTION(nsContentUtils::CanCallerAccess(static_cast<nsIDOMHTMLDocument*>(this)),
"XOWs should have caught this!");
if (!nsContentUtils::CanCallerAccess(static_cast<nsIDOMHTMLDocument*>(this))) {
nsPIDOMWindow *win = GetWindow();
if (win) {
nsCOMPtr<nsIDOMElement> frameElement;
rv = win->GetFrameElement(getter_AddRefs(frameElement));
NS_ENSURE_SUCCESS(rv, rv);
if (frameElement && !nsContentUtils::CanCallerAccess(frameElement)) {
return NS_ERROR_DOM_SECURITY_ERR;
}
}
}
if (!aContentType.EqualsLiteral("text/html") &&
!aContentType.EqualsLiteral("text/plain")) {