From 65e8bdcc717474278880368898488834c695beba Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Mon, 5 Dec 2005 17:35:44 +0000 Subject: [PATCH] bug 244569: Open transient styles before dealing with end tags for residual style tags, so that we don't miss a temporarily closed style. r+sr=jst --- parser/htmlparser/src/CNavDTD.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/parser/htmlparser/src/CNavDTD.cpp b/parser/htmlparser/src/CNavDTD.cpp index cd605cf1f0a5..db561e031fce 100644 --- a/parser/htmlparser/src/CNavDTD.cpp +++ b/parser/htmlparser/src/CNavDTD.cpp @@ -1662,6 +1662,15 @@ CNavDTD::HandleEndToken(CToken* aToken) } else { eHTMLTags theParentTag = mBodyContext->Last(); + // First open transient styles, so that we see any autoclosed style + // tags. + if (nsHTMLElement::IsResidualStyleTag(theChildTag)) { + result = OpenTransientStyles(theChildTag); + if (NS_FAILED(result)) { + return result; + } + } + if (kNotFound == nsHTMLElement::GetIndexOfChildOrSynonym(*mBodyContext, theChildTag)) { @@ -1688,8 +1697,9 @@ CNavDTD::HandleEndToken(CToken* aToken) if (gHTMLElements[theChildTag].HasSpecialProperty(kHandleStrayTag) && mDTDMode != eDTDMode_full_standards && mDTDMode != eDTDMode_almost_standards) { - // Oh boy!! we found a "stray" tag. Nav4.x and IE introduce line break in - // such cases. So, let's simulate that effect for compatibility. + // Oh boy!! we found a "stray" tag. Nav4.x and IE introduce line + // break in such cases. So, let's simulate that effect for + // compatibility. // Ex. Hello

There PRBool theParentContains = -1; if (!CanOmit(theParentTag, theChildTag, theParentContains)) { @@ -1723,12 +1733,6 @@ CNavDTD::HandleEndToken(CToken* aToken) FindAutoCloseTargetForEndTag(theChildTag, *mBodyContext, mDTDMode); if (eHTMLTag_unknown != theTarget) { - if (nsHTMLElement::IsResidualStyleTag(theChildTag)) { - result = OpenTransientStyles(theChildTag); - if (NS_FAILED(result)) { - return result; - } - } result = CloseContainersTo(theTarget, PR_FALSE); } }