Bug 479959 - Reimplement text/plain loading using the HTML5 parser. r=Olli.Pettay.
This commit is contained in:
@@ -866,6 +866,12 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
||||
mTokenizer->start();
|
||||
mExecutor->Start();
|
||||
mExecutor->StartReadingFromStage();
|
||||
|
||||
if (mMode == PLAIN_TEXT) {
|
||||
mTreeBuilder->StartPlainText();
|
||||
mTokenizer->StartPlainText();
|
||||
}
|
||||
|
||||
/*
|
||||
* If you move the following line, be very careful not to cause
|
||||
* WillBuildModel to be called before the document has had its
|
||||
@@ -891,7 +897,7 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
||||
// The line below means that the encoding can end up being wrong if
|
||||
// a view-source URL is loaded without having the encoding hint from a
|
||||
// previous normal load in the history.
|
||||
mReparseForbidden = !(mMode == NORMAL);
|
||||
mReparseForbidden = !(mMode == NORMAL || mMode == PLAIN_TEXT);
|
||||
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mRequest, &rv));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
||||
Reference in New Issue
Block a user