Bug 213517 part 1 - Interpret x-user-defined as windows-1252 in <meta> for compatibility with other browsers. r=smontagu.
This commit is contained in:
@@ -1203,8 +1203,7 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newEncoding.EqualsLiteral("UTF-16") ||
|
||||
newEncoding.EqualsLiteral("UTF-16BE") ||
|
||||
if (newEncoding.EqualsLiteral("UTF-16BE") ||
|
||||
newEncoding.EqualsLiteral("UTF-16LE")) {
|
||||
mTreeBuilder->MaybeComplainAboutCharset("EncMetaUtf16",
|
||||
true,
|
||||
@@ -1212,6 +1211,14 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding)
|
||||
newEncoding.Assign("UTF-8");
|
||||
}
|
||||
|
||||
if (newEncoding.EqualsLiteral("x-user-defined")) {
|
||||
// WebKit/Blink hack for Indian and Armenian legacy sites
|
||||
mTreeBuilder->MaybeComplainAboutCharset("EncMetaUserDefined",
|
||||
true,
|
||||
mTokenizer->getLineNumber());
|
||||
newEncoding.Assign("windows-1252");
|
||||
}
|
||||
|
||||
if (newEncoding.Equals(mCharset)) {
|
||||
if (mCharsetSource < kCharsetFromMetaPrescan) {
|
||||
if (mInitialEncodingWasFromParentFrame) {
|
||||
|
||||
Reference in New Issue
Block a user