Bug 654106 - Avoid registering a script observer in the fragment parsing case. r=bzbarsky.

This commit is contained in:
Henri Sivonen
2011-05-04 09:35:14 +03:00
parent c6cbd457be
commit 357282f953
4 changed files with 25 additions and 23 deletions

View File

@@ -497,6 +497,8 @@ nsHtml5Parser::ParseHtml5Fragment(const nsAString& aSourceBuffer,
nsIURI* uri = doc->GetDocumentURI();
NS_ENSURE_TRUE(uri, NS_ERROR_NOT_AVAILABLE);
mExecutor->EnableFragmentMode(aPreventScriptExecution);
Initialize(doc, uri, nsnull, nsnull);
mExecutor->SetParser(this);
@@ -516,8 +518,6 @@ nsHtml5Parser::ParseHtml5Fragment(const nsAString& aSourceBuffer,
}
#endif
mExecutor->EnableFragmentMode(aPreventScriptExecution);
NS_PRECONDITION(!mExecutor->HasStarted(),
"Tried to start parse without initializing the parser.");
mTreeBuilder->setScriptingEnabled(mExecutor->IsScriptEnabled());