42429 - Preserve newline/whitespace inside TABLE,TR,TBODY,THEAD,TFOOT

50710 - Stop after popping a style stack otherwise it might cause a MLK
r=rickg
This commit is contained in:
harishd%netscape.com 2000-09-12 21:17:47 +00:00
parent ce4f6ba3c2
commit 90be3bf596
4 changed files with 20 additions and 2 deletions

View File

@ -1781,7 +1781,6 @@ nsresult CNavDTD::HandleEndToken(CToken* aToken) {
case eHTMLTag_noframes:
case eHTMLTag_noembed:
case eHTMLTag_noscript:
mHasOpenNoXXX--;
//and allow to fall through...
@ -2318,6 +2317,14 @@ PRBool CNavDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const {
}
}
#endif
if(!result) {
// Bug 42429 - Preserve whitespace inside TABLE,TR,TBODY,TFOOT,etc.,
if(gHTMLElements[aParent].HasSpecialProperty(kBadContentWatch)) {
if(nsHTMLElement::IsWhitespaceTag((eHTMLTags)aChild)) {
result=PR_TRUE;
}
}
}
return result;
}
@ -3181,6 +3188,7 @@ nsresult CNavDTD::CloseNoscript(const nsIParserNode *aNode) {
START_TIMER();
if(NS_SUCCEEDED(result)) {
NS_ASSERTION((mHasOpenNoXXX > -1), "mHasOpenNoXXX underflow");
if(mHasOpenNoXXX > 0) {
mHasOpenNoXXX--;
}

View File

@ -1079,6 +1079,7 @@ nsIParserNode* nsDTDContext::PopStyle(eHTMLTags aTag){
if(aTag==theStack->Last()) {
result=theStack->Pop();
mResidualStyleCount--;
break; // Fix bug 50710 - Stop after finding a style.
} else {
// NS_ERROR("bad residual style entry");
}

View File

@ -1781,7 +1781,6 @@ nsresult CNavDTD::HandleEndToken(CToken* aToken) {
case eHTMLTag_noframes:
case eHTMLTag_noembed:
case eHTMLTag_noscript:
mHasOpenNoXXX--;
//and allow to fall through...
@ -2318,6 +2317,14 @@ PRBool CNavDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const {
}
}
#endif
if(!result) {
// Bug 42429 - Preserve whitespace inside TABLE,TR,TBODY,TFOOT,etc.,
if(gHTMLElements[aParent].HasSpecialProperty(kBadContentWatch)) {
if(nsHTMLElement::IsWhitespaceTag((eHTMLTags)aChild)) {
result=PR_TRUE;
}
}
}
return result;
}
@ -3181,6 +3188,7 @@ nsresult CNavDTD::CloseNoscript(const nsIParserNode *aNode) {
START_TIMER();
if(NS_SUCCEEDED(result)) {
NS_ASSERTION((mHasOpenNoXXX > -1), "mHasOpenNoXXX underflow");
if(mHasOpenNoXXX > 0) {
mHasOpenNoXXX--;
}

View File

@ -1079,6 +1079,7 @@ nsIParserNode* nsDTDContext::PopStyle(eHTMLTags aTag){
if(aTag==theStack->Last()) {
result=theStack->Pop();
mResidualStyleCount--;
break; // Fix bug 50710 - Stop after finding a style.
} else {
// NS_ERROR("bad residual style entry");
}