Revert "Issue #2258 - Part 1: Support XCTO:nosniff when navigating."

This reverts commit f48c770701e62c382631620f4caa1fdc5ab1d7ae.
This commit is contained in:
Moonchild 2025-09-23 18:17:52 +02:00 committed by roytam1
commit 0d00c84033
10 changed files with 5 additions and 103 deletions

View file

@ -166,7 +166,6 @@ nsHtml5StreamParser::nsHtml5StreamParser(nsHtml5TreeOpExecutor* aExecutor,
, mLoadFlusher(new nsHtml5LoadFlusher(aExecutor))
, mFlushTimer(do_CreateInstance("@mozilla.org/timer;1"))
, mMode(aMode)
, mSkipContentSniffing(false)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
mFlushTimer->SetTarget(mThread);
@ -550,7 +549,7 @@ nsHtml5StreamParser::FinalizeSniffing(const uint8_t* aFromSegment, // can be nul
}
// meta scan failed.
if (!mSkipContentSniffing && mCharsetSource >= kCharsetFromHintPrevDoc) {
if (mCharsetSource >= kCharsetFromHintPrevDoc) {
mFeedChardet = false;
return SetupDecodingAndWriteSniffingBufferAndCurrentSegment(aFromSegment, aCount, aWriteCount);
}
@ -875,13 +874,6 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
mObserver->OnStartRequest(aRequest, aContext);
}
mRequest = aRequest;
nsCOMPtr<nsIChannel> myChannel(do_QueryInterface(aRequest));
nsCOMPtr<nsILoadInfo> loadInfo = myChannel->GetLoadInfo();
mSkipContentSniffing = loadInfo->GetSkipContentSniffing();
if (mSkipContentSniffing) {
mFeedChardet = false;
}
mStreamState = STREAM_BEING_READ;