Bug 559311 - [HTML5] nsContentUtils::CreateContextualFragment doesn't cache HTML5 parser properly, r=smaug

This commit is contained in:
Olli Pettay 2010-04-21 14:54:40 +03:00
parent 0640f45817
commit 857f96fac4
3 changed files with 6 additions and 0 deletions

View File

@ -487,6 +487,7 @@ nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
mExecutor->FlushDocumentWrite();
mTokenizer->end();
mExecutor->DropParserAndPerfHint();
mExecutor->DropHeldElements();
mAtomTable.Clear();
return NS_OK;
}

View File

@ -826,6 +826,7 @@ nsHtml5TreeOpExecutor::GetTokenizer()
void
nsHtml5TreeOpExecutor::Reset() {
DropHeldElements();
mHasProcessedBase = PR_FALSE;
mReadingFromStage = PR_FALSE;
mOpQueue.Clear();

View File

@ -368,6 +368,10 @@ class nsHtml5TreeOpExecutor : public nsContentSink,
mOwnedElements.AppendObject(aContent);
}
void DropHeldElements() {
mOwnedElements.Clear();
}
/**
* Flush the operations from the tree operations from the argument
* queue unconditionally. (This is for the main thread case.)