private static void InitializeElementsClosingOnNewElementStart()
{
_htmlElementsClosingColgroup = new ArrayList();
_htmlElementsClosingColgroup.Add("colgroup");
_htmlElementsClosingColgroup.Add("tr");
_htmlElementsClosingColgroup.Add("thead");
_htmlElementsClosingColgroup.Add("tfoot");
_htmlElementsClosingColgroup.Add("tbody");
_htmlElementsClosingDD = new ArrayList();
_htmlElementsClosingDD.Add("dd");
_htmlElementsClosingDD.Add("dt");
// TODO: dd may end in other cases as well - if a new "p" starts, etc.
// TODO: these are the basic "legal" cases but there may be more recovery
_htmlElementsClosingDT = new ArrayList();
_htmlElementsClosingDD.Add("dd");
_htmlElementsClosingDD.Add("dt");
// TODO: dd may end in other cases as well - if a new "p" starts, etc.
// TODO: these are the basic "legal" cases but there may be more recovery
_htmlElementsClosingLI = new ArrayList();
_htmlElementsClosingLI.Add("li");
// TODO: more complex recovery
_htmlElementsClosingTbody = new ArrayList();
_htmlElementsClosingTbody.Add("tbody");
_htmlElementsClosingTbody.Add("thead");
_htmlElementsClosingTbody.Add("tfoot");
// TODO: more complex recovery
_htmlElementsClosingTR = new ArrayList();
// NOTE: tr should not really close on a new thead
// because if there are rows before a thead, it is assumed to be in tbody, whose start tag is optional
// and thead can't come after tbody
// however, if we do encounter this, it's probably best to end the row and ignore the thead or treat
// it as part of the table
_htmlElementsClosingTR.Add("thead");
_htmlElementsClosingTR.Add("tfoot");
_htmlElementsClosingTR.Add("tbody");
_htmlElementsClosingTR.Add("tr");
// TODO: more complex recovery
_htmlElementsClosingTD = new ArrayList();
_htmlElementsClosingTD.Add("td");
_htmlElementsClosingTD.Add("th");
_htmlElementsClosingTD.Add("tr");
_htmlElementsClosingTD.Add("tbody");
_htmlElementsClosingTD.Add("tfoot");
_htmlElementsClosingTD.Add("thead");
// TODO: more complex recovery
_htmlElementsClosingTH = new ArrayList();
_htmlElementsClosingTH.Add("td");
_htmlElementsClosingTH.Add("th");
_htmlElementsClosingTH.Add("tr");
_htmlElementsClosingTH.Add("tbody");
_htmlElementsClosingTH.Add("tfoot");
_htmlElementsClosingTH.Add("thead");
// TODO: more complex recovery
_htmlElementsClosingThead = new ArrayList();
_htmlElementsClosingThead.Add("tbody");
_htmlElementsClosingThead.Add("tfoot");
// TODO: more complex recovery
_htmlElementsClosingTfoot = new ArrayList();
_htmlElementsClosingTfoot.Add("tbody");
// although thead comes before tfoot, we add it because if it is found the tfoot should close
// and some recovery processing be done on the thead
_htmlElementsClosingTfoot.Add("thead");
// TODO: more complex recovery
}