case eHTMLTag_embed: rv = ProcessEMBEDTag(&leaf, aNode); break;
PRInt32 HTMLContentSink::AddLeaf(const nsIParserNode& aNode){  SINK_TRACE_NODE(SINK_TRACE_CALLS,                  "HTMLContentSink::AddLeaf", aNode);  // Check for nodes that require special handling  switch (aNode.GetNodeType()) {  case eHTMLTag_style:    FlushText();    ProcessSTYLETag(aNode);    return 0;  case eHTMLTag_script:    // XXX SCRIPT tag evaluation is currently turned off till we    // get more scripts working.    FlushText();#if 0    ProcessSCRIPTTag(aNode);#endif    return 0;  case eHTMLTag_area:    FlushText();    ProcessAREATag(aNode);    return 0;  case eHTMLTag_meta:    // Add meta objects to the head object    FlushText();    ProcessMETATag(aNode);    return 0;  }  eHTMLTags parentType;  nsIHTMLContent* parent = GetCurrentContainer(&parentType);  switch (parentType) {  /*case eHTMLTag_table:  case eHTMLTag_tr:  case eHTMLTag_tbody:  case eHTMLTag_thead:  case eHTMLTag_tfoot:    // XXX Discard leaf content (those annoying \n's really) in    // table's or table rows    return PR_TRUE;  */  case eHTMLTag_option:    FlushText();    ProcessOPTIONTagContent(aNode);    return 0;  case eHTMLTag_select:    // Discard content in a select that's not an option    if (eHTMLTag_option != aNode.GetNodeType()) {      return 0;    }    break;  }  nsresult rv = NS_OK;  nsIHTMLContent* leaf = nsnull;  switch (aNode.GetTokenType()) {  case eToken_start:    switch (aNode.GetNodeType()) {    case eHTMLTag_br:      FlushText();      rv = ProcessBRTag(&leaf, aNode);      break;    case eHTMLTag_hr:      FlushText();      rv = ProcessHRTag(&leaf, aNode);      break;    case eHTMLTag_input:      FlushText();      rv = ProcessINPUTTag(&leaf, aNode);      break;    case eHTMLTag_img:      FlushText();      rv = ProcessIMGTag(&leaf, aNode);      break;    case eHTMLTag_spacer:      FlushText();      rv = ProcessSPACERTag(&leaf, aNode);      break;    case eHTMLTag_textarea:      FlushText();      ProcessTEXTAREATag(&leaf, aNode);      break;    }    break;  case eToken_text:  case eToken_whitespace:  case eToken_newline:    rv = AddText(aNode.GetText(), &leaf);    break;  case eToken_entity:    {      nsAutoString tmp;      PRInt32 unicode = aNode.TranslateToUnicodeStr(tmp);      if (unicode < 0) {        rv = AddText(aNode.GetText(), &leaf);      }      else {        rv = AddText(tmp, &leaf);      }    }    break;  case eToken_skippedcontent:    break;  }  if (NS_OK == rv) {    if (nsnull != leaf) {      if (nsnull != parent) {        PRBool allowReflow = parent == mBody;#ifdef NS_DEBUG        if (allowReflow) {          SINK_TRACE(SINK_TRACE_REFLOW,                     ("HTMLContentSink::AddLeaf: reflow after append"));        }#endif        AppendToCorrectParent(parentType, parent,                              (nsHTMLTag) aNode.GetNodeType(), leaf,                              allowReflow);      } else {        // XXX drop stuff on the floor that doesn't have a container!        // Bad parser!      }    }  }  NS_IF_RELEASE(leaf);  return 0;}