From e951f0eacdab66b6cc8495891dec9c4df4446317 Mon Sep 17 00:00:00 2001 From: "harishd%netscape.com" Date: Sat, 16 Feb 2002 01:36:50 +0000 Subject: [PATCH] Fixing hang - If misplaced table content turns out to be skipped content then we need to make sure that the rest of the table content belongs to the skipped content until we reach the matching end-skipped-content-tag. b=124788, r=heikki, sr=jst git-svn-id: svn://10.0.0.236/trunk@114636 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/CNavDTD.cpp | 12 ++++++++---- mozilla/parser/htmlparser/src/CNavDTD.cpp | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index a4b22cedec5..85560d7e0a1 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -801,13 +801,17 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){ (gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855 mFlags &= ~NS_DTD_FLAG_MISPLACED_CONTENT; // reset the state since all the misplaced tokens are about to get handled. - result=HandleSavedTokens(mBodyContext->mContextTopIndex); - mBodyContext->mContextTopIndex=-1; + + result = HandleSavedTokens(mBodyContext->mContextTopIndex); + NS_ENSURE_SUCCESS(result, result); - if(NS_FAILED(result)) { + mBodyContext->mContextTopIndex = -1; + + if (mSkipTarget) { + mSkippedContent.Push(theToken); return result; } - //falling through intentionally,i.e., handle the token that is willing to be the child of the current parent. + // Fall through if the skipped content collection is |not| in progress - bug 124788 } else { mMisplacedContent.Push(theToken); diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index a4b22cedec5..85560d7e0a1 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -801,13 +801,17 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){ (gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855 mFlags &= ~NS_DTD_FLAG_MISPLACED_CONTENT; // reset the state since all the misplaced tokens are about to get handled. - result=HandleSavedTokens(mBodyContext->mContextTopIndex); - mBodyContext->mContextTopIndex=-1; + + result = HandleSavedTokens(mBodyContext->mContextTopIndex); + NS_ENSURE_SUCCESS(result, result); - if(NS_FAILED(result)) { + mBodyContext->mContextTopIndex = -1; + + if (mSkipTarget) { + mSkippedContent.Push(theToken); return result; } - //falling through intentionally,i.e., handle the token that is willing to be the child of the current parent. + // Fall through if the skipped content collection is |not| in progress - bug 124788 } else { mMisplacedContent.Push(theToken);