mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1373045 - Avoid double-resolving the replacement encoding. r=emk
MozReview-Commit-ID: F0nOJ2opz0r --HG-- extra : rebase_source : 4dda4f9628f8879626f3fe40df52feba6e18aa00
This commit is contained in:
parent
ebc59facdc
commit
70a5344073
@ -107,9 +107,13 @@ nsresult nsScanner::SetDocumentCharset(const nsACString& aCharset , int32_t aSou
|
||||
mCharsetSource = aSource;
|
||||
|
||||
nsCString charsetName;
|
||||
mozilla::DebugOnly<bool> valid =
|
||||
EncodingUtils::FindEncodingForLabel(aCharset, charsetName);
|
||||
MOZ_ASSERT(valid, "Should never call with a bogus aCharset.");
|
||||
if (aCharset.EqualsLiteral("replacement")) {
|
||||
charsetName.Assign(aCharset);
|
||||
} else {
|
||||
mozilla::DebugOnly<bool> valid =
|
||||
EncodingUtils::FindEncodingForLabel(aCharset, charsetName);
|
||||
MOZ_ASSERT(valid, "Should never call with a bogus aCharset.");
|
||||
}
|
||||
|
||||
if (!mCharset.IsEmpty() && charsetName.Equals(mCharset)) {
|
||||
return NS_OK; // no difference, don't change it
|
||||
|
Loading…
Reference in New Issue
Block a user