From fbfe87c995a29a27cf8b0008b741c2a86b854e4c Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Wed, 13 Jan 1999 08:43:20 +0000 Subject: [PATCH] fixed nested listing bug, and prep work for new logparse system git-svn-id: svn://10.0.0.236/trunk@17650 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/CNavDTD.cpp | 8 ++++---- mozilla/htmlparser/src/nsElementTable.h | 2 ++ mozilla/parser/htmlparser/src/CNavDTD.cpp | 8 ++++---- mozilla/parser/htmlparser/src/nsElementTable.h | 2 ++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 0674dcb9587..eadda1889ed 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -4,7 +4,7 @@ * Version 1.0 (the "NPL"); you may not use this file except in * compliance with the NPL. You may obtain a copy of the NPL at * http://www.mozilla.org/NPL/ - * + * * Software distributed under the NPL is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL * for the specific language governing rights and limitations under the @@ -669,8 +669,8 @@ eHTMLTags FindAutoCloseTargetForStartTag(eHTMLTags aCurrentTag,nsTagStack& aTagS eHTMLTags aPrevTag=aTagStack.mTags[theTopIndex-1]; if(nsHTMLElement::IsContainer(aCurrentTag)){ - if((aPrevTag==aCurrentTag) && (!gHTMLElements[aCurrentTag].CanSelfContain())){ - return aCurrentTag; + if(aPrevTag==aCurrentTag) { + return (gHTMLElements[aCurrentTag].CanSelfContain()) ? eHTMLTag_unknown: aCurrentTag; } if(nsHTMLElement::IsBlockCloser(aCurrentTag)) { @@ -740,9 +740,9 @@ nsresult CNavDTD::HandleDefaultStartToken(CToken* aToken,eHTMLTags aChildTag,nsI if(eHTMLTag_unknown!=theTarget){ result=CloseContainersTo(theTarget,PR_TRUE); theParentTag=mBodyContext->Last(); + theCanContainResult=CanContain(theParentTag,aChildTag); } - if(PR_FALSE==theCanContainResult){ if(CanPropagate(theParentTag,aChildTag)) result=CreateContextStackFor(aChildTag); diff --git a/mozilla/htmlparser/src/nsElementTable.h b/mozilla/htmlparser/src/nsElementTable.h index 7297235352a..da42b0f15d7 100644 --- a/mozilla/htmlparser/src/nsElementTable.h +++ b/mozilla/htmlparser/src/nsElementTable.h @@ -360,6 +360,8 @@ public: gHTMLElements[gStyleTags[index]].mSelfContained=PR_TRUE; } gHTMLElements[eHTMLTag_frameset].mSelfContained=PR_TRUE; + gHTMLElements[eHTMLTag_ol].mSelfContained=PR_TRUE; + gHTMLElements[eHTMLTag_ul].mSelfContained=PR_TRUE; } }; CTableInitializer gTableInitializer; diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 0674dcb9587..eadda1889ed 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -4,7 +4,7 @@ * Version 1.0 (the "NPL"); you may not use this file except in * compliance with the NPL. You may obtain a copy of the NPL at * http://www.mozilla.org/NPL/ - * + * * Software distributed under the NPL is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL * for the specific language governing rights and limitations under the @@ -669,8 +669,8 @@ eHTMLTags FindAutoCloseTargetForStartTag(eHTMLTags aCurrentTag,nsTagStack& aTagS eHTMLTags aPrevTag=aTagStack.mTags[theTopIndex-1]; if(nsHTMLElement::IsContainer(aCurrentTag)){ - if((aPrevTag==aCurrentTag) && (!gHTMLElements[aCurrentTag].CanSelfContain())){ - return aCurrentTag; + if(aPrevTag==aCurrentTag) { + return (gHTMLElements[aCurrentTag].CanSelfContain()) ? eHTMLTag_unknown: aCurrentTag; } if(nsHTMLElement::IsBlockCloser(aCurrentTag)) { @@ -740,9 +740,9 @@ nsresult CNavDTD::HandleDefaultStartToken(CToken* aToken,eHTMLTags aChildTag,nsI if(eHTMLTag_unknown!=theTarget){ result=CloseContainersTo(theTarget,PR_TRUE); theParentTag=mBodyContext->Last(); + theCanContainResult=CanContain(theParentTag,aChildTag); } - if(PR_FALSE==theCanContainResult){ if(CanPropagate(theParentTag,aChildTag)) result=CreateContextStackFor(aChildTag); diff --git a/mozilla/parser/htmlparser/src/nsElementTable.h b/mozilla/parser/htmlparser/src/nsElementTable.h index 7297235352a..da42b0f15d7 100644 --- a/mozilla/parser/htmlparser/src/nsElementTable.h +++ b/mozilla/parser/htmlparser/src/nsElementTable.h @@ -360,6 +360,8 @@ public: gHTMLElements[gStyleTags[index]].mSelfContained=PR_TRUE; } gHTMLElements[eHTMLTag_frameset].mSelfContained=PR_TRUE; + gHTMLElements[eHTMLTag_ol].mSelfContained=PR_TRUE; + gHTMLElements[eHTMLTag_ul].mSelfContained=PR_TRUE; } }; CTableInitializer gTableInitializer;