Bug 1810896 - Adjust assertion to account for ISO-2022-JP at the start but UTF-8 at the end of HTML file. r=emk

Differential Revision: https://phabricator.services.mozilla.com/D170928
This commit is contained in:
Henri Sivonen 2023-02-27 07:51:13 +00:00
parent 31b50af66d
commit 1bc8211238
3 changed files with 1084 additions and 1 deletions

View File

@ -334,7 +334,8 @@ nsHtml5StreamParser::GuessEncoding(bool aInitial) {
} else if (ifHadBeenForced == UTF_8_ENCODING) {
MOZ_ASSERT(mCharsetSource == kCharsetFromInitialAutoDetectionASCII ||
mCharsetSource ==
kCharsetFromInitialAutoDetectionWouldHaveBeenUTF8);
kCharsetFromInitialAutoDetectionWouldHaveBeenUTF8 ||
mEncoding == ISO_2022_JP_ENCODING);
source = kCharsetFromFinalAutoDetectionWouldHaveBeenUTF8InitialWasASCII;
} else if (encoding != ifHadBeenForced) {
if (mCharsetSource == kCharsetFromInitialAutoDetectionASCII) {

File diff suppressed because it is too large Load Diff

View File

@ -64,3 +64,4 @@ load 1604307-1.html
load 1606499-1.html
load 1547895-1.html
skip-if(Android) skip-if(isDebugBuild) load 1747514.html # Bug 1780219
HTTP load 1810896-1.html