Bug 634541 - Make the HTML parser remove only one BOM when the input starts with multiple BOMs. r=bzbarsky

MozReview-Commit-ID: 1zoGFxx9MCm

Differential Revision: https://phabricator.services.mozilla.com/D2926
This commit is contained in:
Henri Sivonen
2018-08-13 08:01:56 +00:00
parent 7e61adcdbe
commit c6043d9297
6 changed files with 61 additions and 1 deletions

View File

@@ -345,7 +345,7 @@ nsHtml5StreamParser::SetupDecodingFromBom(NotNull<const Encoding*> aEncoding)
{
NS_ASSERTION(IsParserThread(), "Wrong thread!");
mEncoding = aEncoding;
mUnicodeDecoder = mEncoding->NewDecoderWithBOMRemoval();
mUnicodeDecoder = mEncoding->NewDecoderWithoutBOMHandling();
mCharsetSource = kCharsetFromByteOrderMark;
mFeedChardet = false;
mTreeBuilder->SetDocumentCharset(mEncoding, mCharsetSource);