mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 234628 part 1 - Make the BOM take precedence over manual encoding overrides. r=smaug.
This commit is contained in:
parent
c0519c5841
commit
7f2f8a25e2
@ -938,17 +938,17 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWyciwygChannel> wyciwygChannel(do_QueryInterface(mRequest));
|
||||
if (wyciwygChannel) {
|
||||
mReparseForbidden = true;
|
||||
mFeedChardet = false;
|
||||
// If we are reloading a document.open()ed doc, fall through to converter
|
||||
// instantiation here and avoid BOM sniffing.
|
||||
} else if (mCharsetSource < kCharsetFromParentForced) {
|
||||
if (!wyciwygChannel) {
|
||||
// we aren't ready to commit to an encoding yet
|
||||
// leave converter uninstantiated for now
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// We are reloading a document.open()ed doc.
|
||||
mReparseForbidden = true;
|
||||
mFeedChardet = false;
|
||||
|
||||
// Instantiate the converter here to avoid BOM sniffing.
|
||||
nsCOMPtr<nsICharsetConverterManager> convManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = convManager->GetUnicodeDecoder(mCharset.get(), getter_AddRefs(mUnicodeDecoder));
|
||||
|
@ -19,10 +19,8 @@
|
||||
#define kCharsetFromIrreversibleAutoDetection 10
|
||||
#define kCharsetFromChannel 11
|
||||
#define kCharsetFromOtherComponent 12
|
||||
#define kCharsetFromByteOrderMark 13
|
||||
// Levels below here will be forced onto childframes too
|
||||
#define kCharsetFromParentForced 14
|
||||
#define kCharsetFromUserForced 15
|
||||
#define kCharsetFromPreviousLoading 16
|
||||
#define kCharsetFromParentForced 13 // propagates to child frames
|
||||
#define kCharsetFromUserForced 14 // propagates to child frames
|
||||
#define kCharsetFromByteOrderMark 15
|
||||
|
||||
#endif /* nsCharsetSource_h_ */
|
||||
|
Loading…
Reference in New Issue
Block a user