Bug 659763 - Make document.open("text/plain") work with the new parser. r=Olli.Pettay.
This commit is contained in:
@@ -239,7 +239,7 @@ nsHtml5Parser::Parse(nsIURI* aURL, // legacy parameter; ignored
|
||||
NS_IMETHODIMP
|
||||
nsHtml5Parser::Parse(const nsAString& aSourceBuffer,
|
||||
void* aKey,
|
||||
const nsACString& aContentType, // ignored
|
||||
const nsACString& aContentType,
|
||||
bool aLastCall,
|
||||
nsDTDMode aMode) // ignored
|
||||
{
|
||||
@@ -270,6 +270,10 @@ nsHtml5Parser::Parse(const nsAString& aSourceBuffer,
|
||||
mTreeBuilder->setScriptingEnabled(mExecutor->IsScriptEnabled());
|
||||
mTokenizer->start();
|
||||
mExecutor->Start();
|
||||
if (!aContentType.EqualsLiteral("text/html")) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user