From 96e6386945d289969eb39b9a325fac588051ad9c Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Mon, 6 Mar 2006 22:13:41 +0000 Subject: [PATCH] Protect against our table container being closed before we're ready by using the same logic to find the close tag that HandleEndToken does. bug 329364, r+sr=jst git-svn-id: svn://10.0.0.236/trunk@191845 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/parser/htmlparser/src/CNavDTD.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index ec5ff97e84d..b1d54b7bd4f 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -1750,7 +1750,11 @@ CNavDTD::HandleSavedTokens(PRInt32 anIndex) // EndContext(). Ex:
. // In the Ex. above should not close
above table. // Doing so will cause the current context to get closed prematurely. - PRInt32 theIndex = mBodyContext->LastOf(theTag); + eHTMLTags closed = FindAutoCloseTargetForEndTag(theTag, *mBodyContext, + mDTDMode); + PRInt32 theIndex = closed != eHTMLTag_unknown + ? mBodyContext->LastOf(closed) + : kNotFound; if (theIndex != kNotFound && theIndex <= mBodyContext->mContextTopIndex) {