#138002 nsParser should be accept charset notification coming from low priority source

check charset source before updating parser's charset.
r=ftang, sr=jst
This commit is contained in:
shanjian%netscape.com 2002-04-18 22:21:50 +00:00
parent 8332198ead
commit 6c2e95366a

View File

@ -63,7 +63,11 @@ NS_IMETHODIMP nsMyObserver::Notify(
mWeakRefDocument->SetDocumentCharacterSet(newcharset);
}
if(mWeakRefParser) {
mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection);
nsAutoString existingCharset;
PRInt32 existingSource;
mWeakRefParser->GetDocumentCharset(existingCharset, existingSource);
if (existingSource < kCharsetFromAutoDetection)
mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection);
}
}
}