Bug 596182 - Make fragment parsers global. Remove resulting dead code. r=Olli.Pettay, r=bzbarsky.

This commit is contained in:
Henri Sivonen
2011-08-01 10:48:24 +03:00
parent ca061c97f8
commit 2fa0fb46af
34 changed files with 359 additions and 1233 deletions

View File

@@ -57,6 +57,7 @@
#include "nsHtml5Tokenizer.h"
#include "nsHtml5TreeBuilder.h"
#include "nsHtml5StreamParser.h"
#include "mozilla/css/Loader.h"
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHtml5TreeOpExecutor)
@@ -307,8 +308,10 @@ nsHtml5TreeOpExecutor::UpdateStyleSheet(nsIContent* aElement)
PRBool willNotify;
PRBool isAlternate;
nsresult rv = ssle->UpdateStyleSheet(this, &willNotify, &isAlternate);
if (NS_SUCCEEDED(rv) && willNotify && !isAlternate) {
nsresult rv = ssle->UpdateStyleSheet(mFragmentMode ? nsnull : this,
&willNotify,
&isAlternate);
if (NS_SUCCEEDED(rv) && willNotify && !isAlternate && !mFragmentMode) {
++mPendingSheetCount;
mScriptLoader->AddExecuteBlocker();
}
@@ -805,14 +808,26 @@ nsHtml5TreeOpExecutor::GetTokenizer()
}
void
nsHtml5TreeOpExecutor::Reset() {
nsHtml5TreeOpExecutor::Reset()
{
DropHeldElements();
mReadingFromStage = PR_FALSE;
mOpQueue.Clear();
mStarted = PR_FALSE;
mFlushState = eNotFlushing;
mRunFlushLoopOnStack = PR_FALSE;
mFragmentMode = PR_FALSE;
}
void
nsHtml5TreeOpExecutor::DropHeldElements()
{
mScriptLoader = nsnull;
mDocument = nsnull;
mNodeInfoManager = nsnull;
mCSSLoader = nsnull;
mDocumentURI = nsnull;
mDocShell = nsnull;
mOwnedElements.Clear();
}
void