Make sure to collect FORM attributes if the FORM was found along with misplaced content inside TABLE. b=142965, r=heikki, sr=jst. Added -/W3C/DTD HTML 4.0 Transitional/EN to the quirks list. b=146274, r=heikki, sr=dbaron

This commit is contained in:
harishd%netscape.com 2002-12-03 19:55:19 +00:00
Родитель b79654cec5
Коммит 75613686ba
4 изменённых файлов: 18 добавлений и 14 удалений

Просмотреть файл

@ -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};
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))) ||
(gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855
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.

Просмотреть файл

@ -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},
};

Просмотреть файл

@ -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};
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))) ||
(gHTMLElements[theParentTag].CanContain(theTag)) && (theTag!=eHTMLTag_comment)) { // Added comment -> bug 40855
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.

Просмотреть файл

@ -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},
};