Decrement mOpenFormCount only if there's an open form. b=115262, r=heikki, sr=jst.\n Counter related code should be DEBUG only. b=92618, r=heikki, sr=jst

git-svn-id: svn://10.0.0.236/trunk@111949 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
2002-01-11 19:33:31 +00:00
parent ecb20fc642
commit 8ca1a4cdc8
10 changed files with 126 additions and 76 deletions

View File

@@ -355,7 +355,9 @@ nsresult COtherDTD::WillBuildModel( const CParserContext& aParserContext,nsICon
if(result==NS_OK) {
result = aSink->WillBuildModel();
#ifdef DEBUG
mBodyContext->ResetCounters();
#endif
MOZ_TIMER_DEBUGLOG(("Start: Parse Time: COtherDTD::WillBuildModel(), this=%p\n", this));
START_TIMER();
@@ -574,6 +576,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
}
break;
#ifdef DEBUG
case eHTMLTag_meta:
{
//we should only enable user-defined entities in debug builds...
@@ -602,6 +605,7 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
}
}
break;
#endif
default:
break;
@@ -840,19 +844,23 @@ nsresult COtherDTD::HandleEntityToken(CToken* aToken) {
if((kHashsign!=theChar) && (-1==nsHTMLEntities::EntityToUnicode(theStr))){
#ifdef DEBUG
//before we just toss this away as a bogus entity, let's check...
CNamedEntity *theEntity=mBodyContext->GetEntity(theStr);
if(theEntity) {
theToken=(CTextToken*)mTokenAllocator->CreateTokenOfType(eToken_text,eHTMLTag_text,theEntity->mValue);
}
else {
#endif
//if you're here we have a bogus entity.
//convert it into a text token.
nsAutoString entityName;
entityName.Assign(NS_LITERAL_STRING("&"));
entityName.Append(theStr); //should append the entity name; fix bug 51161.
theToken=(CTextToken*)mTokenAllocator->CreateTokenOfType(eToken_text,eHTMLTag_text,entityName);
#ifdef DEBUG
}
#endif
result=HandleStartToken(theToken);
}
else {