98261 - Instead of throwing away the current tag close it's parent such that the stack level does not go beyond the reflow depth limit. This would allow leaf tags, that follow the current tag, to find the correct node. r=heikki, sr=attinasi.

git-svn-id: svn://10.0.0.236/trunk@102933 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
2001-09-14 20:45:16 +00:00
parent 7c0676bf06
commit beea70d29d
2 changed files with 30 additions and 14 deletions

View File

@@ -1341,13 +1341,21 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNode
* </P> is encountered by itself (<P>) is continuously produced.
*
**************************************************************************************/
if(MAX_REFLOW_DEPTH<mBodyContext->GetCount()) {
if(nsHTMLElement::IsContainer(aTag)) {
if(!gHTMLElements[aTag].HasSpecialProperty(kHandleStrayTag)) {
return kHierarchyTooDeep; //drop the container on the floor.
}
}
PRInt32 stackDepth = mBodyContext->GetCount();
if (stackDepth > MAX_REFLOW_DEPTH) {
if (nsHTMLElement::IsContainer(aTag) &&
!gHTMLElements[aTag].HasSpecialProperty(kHandleStrayTag)) {
// Ref. bug 98261,49678,55095,55980
// Instead of throwing away the current tag close it's parent
// such that the stack level does not go beyond the max_reflow_depth.
// This would allow leaf tags, that follow the current tag, to find
// the correct node.
while (stackDepth != MAX_REFLOW_DEPTH && NS_SUCCEEDED(result)) {
result = CloseContainersTo(mBodyContext->Last(),PR_FALSE);
--stackDepth;
}
}
}
STOP_TIMER()

View File

@@ -1341,13 +1341,21 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNode
* </P> is encountered by itself (<P>) is continuously produced.
*
**************************************************************************************/
if(MAX_REFLOW_DEPTH<mBodyContext->GetCount()) {
if(nsHTMLElement::IsContainer(aTag)) {
if(!gHTMLElements[aTag].HasSpecialProperty(kHandleStrayTag)) {
return kHierarchyTooDeep; //drop the container on the floor.
}
}
PRInt32 stackDepth = mBodyContext->GetCount();
if (stackDepth > MAX_REFLOW_DEPTH) {
if (nsHTMLElement::IsContainer(aTag) &&
!gHTMLElements[aTag].HasSpecialProperty(kHandleStrayTag)) {
// Ref. bug 98261,49678,55095,55980
// Instead of throwing away the current tag close it's parent
// such that the stack level does not go beyond the max_reflow_depth.
// This would allow leaf tags, that follow the current tag, to find
// the correct node.
while (stackDepth != MAX_REFLOW_DEPTH && NS_SUCCEEDED(result)) {
result = CloseContainersTo(mBodyContext->Last(),PR_FALSE);
--stackDepth;
}
}
}
STOP_TIMER()