Bug 1736248 - Update the charset source if non-ASCII is seen after the first detector guess but the encoding does not change. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D133731
This commit is contained in:
Henri Sivonen
2021-12-14 15:01:21 +00:00
parent fb1ffb83e9
commit 0046e78e32
4 changed files with 45 additions and 0 deletions

View File

@@ -2273,6 +2273,11 @@ void nsHtml5StreamParser::ParseAvailableData() {
source == kCharsetFromFinalUserForcedAutoDetection);
mTreeBuilder->NeedsCharsetSwitchTo(encoding, source, 0);
requestedReload = true;
} else if (mCharsetSource ==
kCharsetFromInitialAutoDetectionASCII &&
mDetectorHasSeenNonAscii) {
mCharsetSource = source;
mTreeBuilder->SetDocumentCharset(mEncoding, mCharsetSource);
}
}