diff --git a/htmlparser/src/CNavDTD.cpp b/htmlparser/src/CNavDTD.cpp index 55b68f53ed8..6a0e13c53ec 100644 --- a/htmlparser/src/CNavDTD.cpp +++ b/htmlparser/src/CNavDTD.cpp @@ -799,13 +799,14 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){ } else if(mFlags & NS_DTD_FLAG_MISPLACED_CONTENT) { // Included TD & TH to fix Bug# 20797 - static eHTMLTags gLegalElements[]={eHTMLTag_table,eHTMLTag_thead,eHTMLTag_tbody, - eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tfoot}; - if(theToken) { - eHTMLTags theParentTag=mBodyContext->Last(); - theTag=(eHTMLTags)theToken->GetTypeID(); - if((FindTagInSet(theTag,gLegalElements,sizeof(gLegalElements)/sizeof(theTag))) || - (gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855 + static eHTMLTags gLegalElements[] = {eHTMLTag_table, eHTMLTag_tr, eHTMLTag_td, + eHTMLTag_th, eHTMLTag_caption, eHTMLTag_colgroup, + eHTMLTag_col, eHTMLTag_tbody, eHTMLTag_thead, + eHTMLTag_tfoot}; + if (theToken) { + eHTMLTags theParentTag = mBodyContext->Last(); + theTag = (eHTMLTags)theToken->GetTypeID(); + if (FindTagInSet(theTag,gLegalElements,sizeof(gLegalElements)/sizeof(theTag))) { mFlags &= ~NS_DTD_FLAG_MISPLACED_CONTENT; // reset the state since all the misplaced tokens are about to get handled. diff --git a/htmlparser/src/nsParser.cpp b/htmlparser/src/nsParser.cpp index eb2e76f3e16..289b73b911d 100644 --- a/htmlparser/src/nsParser.cpp +++ b/htmlparser/src/nsParser.cpp @@ -972,6 +972,7 @@ static const PubIDInfo kPublicIDs[] = { {"-//w3o//dtd w3 html strict 3.0//en//" /* "-//W3O//DTD W3 HTML Strict 3.0//EN//" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, {"-//webtechs//dtd mozilla html 2.0//en" /* "-//WebTechs//DTD Mozilla HTML 2.0//EN" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, {"-//webtechs//dtd mozilla html//en" /* "-//WebTechs//DTD Mozilla HTML//EN" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, + {"-/w3c/dtd html 4.0 transitional/en" /* "-/W3C/DTD HTML 4.0 Transitional/EN" */, PubIDInfo::eQuirks, PubIDInfo::eQuirks}, {"html" /* "HTML" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, }; diff --git a/parser/htmlparser/src/CNavDTD.cpp b/parser/htmlparser/src/CNavDTD.cpp index 55b68f53ed8..6a0e13c53ec 100644 --- a/parser/htmlparser/src/CNavDTD.cpp +++ b/parser/htmlparser/src/CNavDTD.cpp @@ -799,13 +799,14 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){ } else if(mFlags & NS_DTD_FLAG_MISPLACED_CONTENT) { // Included TD & TH to fix Bug# 20797 - static eHTMLTags gLegalElements[]={eHTMLTag_table,eHTMLTag_thead,eHTMLTag_tbody, - eHTMLTag_tr,eHTMLTag_td,eHTMLTag_th,eHTMLTag_tfoot}; - if(theToken) { - eHTMLTags theParentTag=mBodyContext->Last(); - theTag=(eHTMLTags)theToken->GetTypeID(); - if((FindTagInSet(theTag,gLegalElements,sizeof(gLegalElements)/sizeof(theTag))) || - (gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855 + static eHTMLTags gLegalElements[] = {eHTMLTag_table, eHTMLTag_tr, eHTMLTag_td, + eHTMLTag_th, eHTMLTag_caption, eHTMLTag_colgroup, + eHTMLTag_col, eHTMLTag_tbody, eHTMLTag_thead, + eHTMLTag_tfoot}; + if (theToken) { + eHTMLTags theParentTag = mBodyContext->Last(); + theTag = (eHTMLTags)theToken->GetTypeID(); + if (FindTagInSet(theTag,gLegalElements,sizeof(gLegalElements)/sizeof(theTag))) { mFlags &= ~NS_DTD_FLAG_MISPLACED_CONTENT; // reset the state since all the misplaced tokens are about to get handled. diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index eb2e76f3e16..289b73b911d 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -972,6 +972,7 @@ static const PubIDInfo kPublicIDs[] = { {"-//w3o//dtd w3 html strict 3.0//en//" /* "-//W3O//DTD W3 HTML Strict 3.0//EN//" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, {"-//webtechs//dtd mozilla html 2.0//en" /* "-//WebTechs//DTD Mozilla HTML 2.0//EN" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, {"-//webtechs//dtd mozilla html//en" /* "-//WebTechs//DTD Mozilla HTML//EN" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, + {"-/w3c/dtd html 4.0 transitional/en" /* "-/W3C/DTD HTML 4.0 Transitional/EN" */, PubIDInfo::eQuirks, PubIDInfo::eQuirks}, {"html" /* "HTML" */, PubIDInfo::eQuirks3, PubIDInfo::eQuirks3}, };