Only do this security check if we don't already have a parser, since this call

won't do anything anyway. bug 364309, r+sr=bzbarsky


git-svn-id: svn://10.0.0.236/trunk@217852 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2007-01-05 22:02:22 +00:00
parent 4bd8f451dd
commit e81b436e63

View File

@@ -1895,6 +1895,12 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
nsresult rv = NS_OK;
// If we already have a parser we ignore the document.open call.
if (mParser) {
return NS_OK;
}
if (!nsContentUtils::CanCallerAccess(NS_STATIC_CAST(nsIDOMHTMLDocument*, this))) {
nsPIDOMWindow *win = GetWindow();
if (win) {
@@ -1908,12 +1914,6 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
}
}
// If we already have a parser we ignore the document.open call.
if (mParser) {
return NS_OK;
}
if (!aContentType.EqualsLiteral("text/html") &&
!aContentType.EqualsLiteral("text/plain")) {
NS_WARNING("Unsupported type; fix the caller");