Don't unblock onload on the document if we no longer have a parser. Bug375051, r=mbkap, sr=sicking

This commit is contained in:
bzbarsky@mit.edu 2007-04-26 21:05:08 -07:00
Родитель bb11c49afb
Коммит b93abe4bf4
3 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1350,6 +1350,11 @@ nsContentSink::DidBuildModelImpl(void)
void void
nsContentSink::DropParserAndPerfHint(void) nsContentSink::DropParserAndPerfHint(void)
{ {
if (!mParser) {
// Make sure we don't unblock unload too many times
return;
}
// Ref. Bug 49115 // Ref. Bug 49115
// Do this hack to make sure that the parser // Do this hack to make sure that the parser
// doesn't get destroyed, accidently, before // doesn't get destroyed, accidently, before

Просмотреть файл

@ -1872,6 +1872,7 @@ HTMLContentSink::DidBuildModel(void)
NS_IMETHODIMP NS_IMETHODIMP
HTMLContentSink::SetParser(nsIParser* aParser) HTMLContentSink::SetParser(nsIParser* aParser)
{ {
NS_PRECONDITION(aParser, "Should have a parser here!");
mParser = aParser; mParser = aParser;
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -449,6 +449,7 @@ nsXMLContentSink::WillResume(void)
NS_IMETHODIMP NS_IMETHODIMP
nsXMLContentSink::SetParser(nsIParser* aParser) nsXMLContentSink::SetParser(nsIParser* aParser)
{ {
NS_PRECONDITION(aParser, "Should have a parser here!");
mParser = aParser; mParser = aParser;
return NS_OK; return NS_OK;
} }