bug 295596: <li> was closing styles on the transient style stack for no good reason, causing them to be lost. This special-cases <li> to not do that. r=bzbarsky sr=jst a=shaver

git-svn-id: svn://10.0.0.236/trunk@173984 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-06-01 21:14:01 +00:00
parent 030d071cd2
commit cf7901ce09
2 changed files with 11 additions and 10 deletions

View File

@@ -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) {

View File

@@ -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);