Make sure documents have a content type at creation time. Bug 311218,
r=sicking, sr=jst git-svn-id: svn://10.0.0.236/trunk@195015 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -325,7 +325,8 @@ IdAndNameHashInitEntry(PLDHashTable *table, PLDHashEntryHdr *entry,
|
||||
// bother initializing members to 0.
|
||||
|
||||
nsHTMLDocument::nsHTMLDocument()
|
||||
: mCompatMode(eCompatibility_NavQuirks),
|
||||
: nsDocument("text/html"),
|
||||
mCompatMode(eCompatibility_NavQuirks),
|
||||
mDefaultNamespaceID(kNameSpaceID_None)
|
||||
{
|
||||
|
||||
@@ -1922,6 +1923,12 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!aContentType.EqualsLiteral("text/html") &&
|
||||
!aContentType.EqualsLiteral("text/plain")) {
|
||||
NS_WARNING("Unsupported type; fix the caller");
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Note: We want to use GetDocumentFromContext here because this document
|
||||
|
||||
Reference in New Issue
Block a user