Don't propagate encoding up to the parent document viewer. Bug 315381, r+sr=jst

git-svn-id: svn://10.0.0.236/trunk@195343 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
smontagu%smontagu.org
2006-04-25 06:57:31 +00:00
parent 43fcdd75f3
commit a42a849983

View File

@@ -792,6 +792,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// The following logic is mirrored in nsWebShell::Embed!
//
nsCOMPtr<nsIMarkupDocumentViewer> muCV;
PRBool muCVIsParent = PR_FALSE;
nsCOMPtr<nsIContentViewer> cv;
docShell->GetContentViewer(getter_AddRefs(cv));
if (cv) {
@@ -813,6 +814,9 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
if (NS_FAILED(rv)) { return rv; }
if (parentContentViewer) {
muCV = do_QueryInterface(parentContentViewer);
if (muCV) {
muCVIsParent = PR_TRUE;
}
}
}
}
@@ -822,6 +826,9 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCAutoString urlSpec;
uri->GetSpec(urlSpec);
#ifdef DEBUG_charset
printf("Determining charset for %s\n", urlSpec.get());
#endif
PRInt32 charsetSource;
nsCAutoString charset;
@@ -899,7 +906,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
SetDocumentCharacterSetSource(charsetSource);
// set doc charset to muCV for next document.
if (muCV)
// Don't propagate this back up to the parent document if we have one.
if (muCV && !muCVIsParent)
muCV->SetPrevDocCharacterSet(charset);
if(cacheDescriptor) {
@@ -916,10 +924,8 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
}
#ifdef DEBUG_charset
char* cCharset = ToNewCString(charset);
printf("set to parser charset = %s source %d\n",
cCharset, charsetSource);
Recycle(cCharset);
printf(" charset = %s source %d\n",
charset.get(), charsetSource);
#endif
mParser->SetDocumentCharset(charset, charsetSource);
mParser->SetCommand(aCommand);