diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 149b237cb59..07f21b9c755 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -2794,7 +2794,7 @@ eHTMLTags CNavDTD::GetTopNode() const { * @param tag of the container just opened * @return 0 (for now) */ -nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){ +nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag, PRBool aCloseInvalid){ nsresult result=NS_OK; // No need to open transient styles in head context - Fix for 41427 @@ -2853,7 +2853,7 @@ nsresult CNavDTD::OpenTransientStyles(eHTMLTags aChildTag){ result = OpenContainer(theNode,theNodeTag,PR_FALSE,theStack); } } - else { + else if (aCloseInvalid) { //if the node tag can't contain the child tag, then remove the child tag from the style stack nsCParserNode* node=theStack->Remove(sindex,theNodeTag); IF_FREE(node, &mNodeAllocator); @@ -3251,7 +3251,7 @@ CNavDTD::OpenContainer(const nsCParserNode *aNode, * ***********************************************************************/ - OpenTransientStyles(aTag); + OpenTransientStyles(aTag, !li_tag); } switch (aTag) { diff --git a/mozilla/parser/htmlparser/src/CNavDTD.h b/mozilla/parser/htmlparser/src/CNavDTD.h index 143ffb65f01..c412874eabb 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.h +++ b/mozilla/parser/htmlparser/src/CNavDTD.h @@ -234,8 +234,8 @@ public: /** * Accessor that retrieves the tag type of the topmost item on context - * vector stack. - * + * vector stack. + * * @update gess5/11/98 * @return tag type (may be unknown) */ @@ -284,7 +284,7 @@ public: /** * The next set of method open given HTML elements of - * various types. + * various types. * * @update gess5/11/98 * @param node to be opened in content sink. @@ -341,14 +341,15 @@ public: /** * This set of methods is used to create and manage the set of - * transient styles that occur as a result of poorly formed HTML - * or bugs in the original navigator. - * + * transient styles that occur as a result of poorly formed HTML + * or bugs in the original navigator. + * * @update gess5/11/98 * @param aTag -- represents the transient style tag to be handled. * @return error code -- usually 0 */ - nsresult OpenTransientStyles(eHTMLTags aChildTag); + nsresult OpenTransientStyles(eHTMLTags aChildTag, + PRBool aCloseInvalid = PR_TRUE); nsresult CloseTransientStyles(eHTMLTags aChildTag); nsresult PopStyle(eHTMLTags aTag);