mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 14:20:14 +02:00
#169858 Browser--Can not login CMB website.
Suppress autodetection notification when charset source is higher. r=jkeiser, jebak, sr=jst.
This commit is contained in:
parent
4a3c2f3f91
commit
16213854e2
1 changed files with 16 additions and 13 deletions
|
|
@ -53,27 +53,30 @@ NS_IMETHODIMP nsMyObserver::Notify(
|
||||||
const char* aCharset, nsDetectionConfident aConf)
|
const char* aCharset, nsDetectionConfident aConf)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
|
if(mWeakRefParser) {
|
||||||
|
nsAutoString existingCharset;
|
||||||
|
PRInt32 existingSource;
|
||||||
|
mWeakRefParser->GetDocumentCharset(existingCharset, existingSource);
|
||||||
|
if (existingSource >= kCharsetFromAutoDetection)
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if(!mCharset.EqualsWithConversion(aCharset)) {
|
if(!mCharset.EqualsWithConversion(aCharset)) {
|
||||||
if(mNotifyByReload) {
|
if(mNotifyByReload) {
|
||||||
rv = mWebShellSvc->SetRendering( PR_FALSE);
|
rv = mWebShellSvc->SetRendering( PR_FALSE);
|
||||||
rv = mWebShellSvc->StopDocumentLoad();
|
rv = mWebShellSvc->StopDocumentLoad();
|
||||||
rv = mWebShellSvc->ReloadDocument(aCharset, kCharsetFromAutoDetection);
|
rv = mWebShellSvc->ReloadDocument(aCharset, kCharsetFromAutoDetection);
|
||||||
} else {
|
} else {
|
||||||
nsAutoString existingCharset;
|
|
||||||
PRInt32 existingSource;
|
|
||||||
nsAutoString newcharset; newcharset.AssignWithConversion(aCharset);
|
nsAutoString newcharset; newcharset.AssignWithConversion(aCharset);
|
||||||
if(mWeakRefParser) {
|
if (mWeakRefParser) {
|
||||||
mWeakRefParser->GetDocumentCharset(existingCharset, existingSource);
|
mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection);
|
||||||
if (existingSource < kCharsetFromAutoDetection) {
|
nsCOMPtr<nsIContentSink> contentSink = mWeakRefParser->GetContentSink();
|
||||||
mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection);
|
if (contentSink)
|
||||||
nsCOMPtr<nsIContentSink> contentSink = mWeakRefParser->GetContentSink();
|
contentSink->SetDocumentCharset(newcharset);
|
||||||
if (contentSink)
|
|
||||||
contentSink->SetDocumentCharset(newcharset);
|
|
||||||
|
|
||||||
if(mWeakRefDocument)
|
|
||||||
mWeakRefDocument->SetDocumentCharacterSet(newcharset);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if(mWeakRefDocument)
|
||||||
|
mWeakRefDocument->SetDocumentCharacterSet(newcharset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue