Fix for
38601 - Calling DidBuildModel(), through nsParser::Terminate(),
for documents stopped abruptly ( stopped before a complete load ).
Fixed a few warnings.
r=nisheeth
git-svn-id: svn://10.0.0.236/trunk@69863 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1105,11 +1105,7 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNode
|
||||
|
||||
CObserverService* theService=mParser->GetObserverService();
|
||||
if(theService) {
|
||||
CParserContext* pc=mParser->PeekContext();
|
||||
void* theDocID=(pc)? pc->mKey:0;
|
||||
|
||||
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
|
||||
|
||||
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,7 +856,7 @@ CToken* CTokenRecycler::CreateTokenOfType(eHTMLTokenTypes aType,eHTMLTags aTag)
|
||||
|
||||
CNodeRecycler::CNodeRecycler(): mSharedNodes(0) {
|
||||
|
||||
MOZ_COUNT_CTOR(CTokenRecycler);
|
||||
MOZ_COUNT_CTOR(CNodeRecycler);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
gNodeCount=0;
|
||||
@@ -865,7 +865,7 @@ CNodeRecycler::CNodeRecycler(): mSharedNodes(0) {
|
||||
|
||||
CNodeRecycler::~CNodeRecycler() {
|
||||
|
||||
MOZ_COUNT_DTOR(CTokenRecycler);
|
||||
MOZ_COUNT_DTOR(CNodeRecycler);
|
||||
|
||||
nsCParserNode* theNode=0;
|
||||
|
||||
|
||||
@@ -1049,9 +1049,13 @@ void nsParser::SetUnusedInput(nsString& aBuffer) {
|
||||
*/
|
||||
nsresult nsParser::Terminate(void){
|
||||
nsresult result=NS_OK;
|
||||
if(mParserContext && mParserContext->mDTD)
|
||||
if(mParserContext && mParserContext->mDTD) {
|
||||
result=mParserContext->mDTD->Terminate();
|
||||
mInternalState=result;
|
||||
if(result==NS_ERROR_HTMLPARSER_STOPPARSING) {
|
||||
mInternalState=result;
|
||||
result=DidBuildModel(result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsParserBundle ();
|
||||
~nsParserBundle ();
|
||||
virtual ~nsParserBundle ();
|
||||
|
||||
/**
|
||||
* Retrieve data from the bundle by IID.
|
||||
|
||||
@@ -1105,11 +1105,7 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNode
|
||||
|
||||
CObserverService* theService=mParser->GetObserverService();
|
||||
if(theService) {
|
||||
CParserContext* pc=mParser->PeekContext();
|
||||
void* theDocID=(pc)? pc->mKey:0;
|
||||
|
||||
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
|
||||
|
||||
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,7 +856,7 @@ CToken* CTokenRecycler::CreateTokenOfType(eHTMLTokenTypes aType,eHTMLTags aTag)
|
||||
|
||||
CNodeRecycler::CNodeRecycler(): mSharedNodes(0) {
|
||||
|
||||
MOZ_COUNT_CTOR(CTokenRecycler);
|
||||
MOZ_COUNT_CTOR(CNodeRecycler);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
gNodeCount=0;
|
||||
@@ -865,7 +865,7 @@ CNodeRecycler::CNodeRecycler(): mSharedNodes(0) {
|
||||
|
||||
CNodeRecycler::~CNodeRecycler() {
|
||||
|
||||
MOZ_COUNT_DTOR(CTokenRecycler);
|
||||
MOZ_COUNT_DTOR(CNodeRecycler);
|
||||
|
||||
nsCParserNode* theNode=0;
|
||||
|
||||
|
||||
@@ -1049,9 +1049,13 @@ void nsParser::SetUnusedInput(nsString& aBuffer) {
|
||||
*/
|
||||
nsresult nsParser::Terminate(void){
|
||||
nsresult result=NS_OK;
|
||||
if(mParserContext && mParserContext->mDTD)
|
||||
if(mParserContext && mParserContext->mDTD) {
|
||||
result=mParserContext->mDTD->Terminate();
|
||||
mInternalState=result;
|
||||
if(result==NS_ERROR_HTMLPARSER_STOPPARSING) {
|
||||
mInternalState=result;
|
||||
result=DidBuildModel(result);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsParserBundle ();
|
||||
~nsParserBundle ();
|
||||
virtual ~nsParserBundle ();
|
||||
|
||||
/**
|
||||
* Retrieve data from the bundle by IID.
|
||||
|
||||
Reference in New Issue
Block a user