result = NS_CreateHTMLElement(&content, nodeType);
NS_WITH_SERVICE(nsIParserService, parserService, kParserServiceCID, &result); NS_ENSURE_SUCCESS(result, result);  nsAutoString tmpName;  if (nodeType == eHTMLTag_userdefined) { tmpName = aNode.GetText(); } else { result = parserService->HTMLIdToStringTag(nodeType, tmpName); NS_ENSURE_SUCCESS(result, result); }  nsCOMPtr<nsINodeInfo> nodeInfo; result = mNodeInfoManager->GetNodeInfo(tmpName, nsnull, kNameSpaceID_None, *getter_AddRefs(nodeInfo));  result = NS_CreateHTMLElement(&content, nodeInfo);
nsHTMLFragmentContentSink::OpenContainer(const nsIParserNode& aNode){  nsAutoString tag;  nsresult result = NS_OK;  tag.Assign(aNode.GetText());  if (tag.EqualsIgnoreCase(kSentinelStr)) {    mHitSentinel = PR_TRUE;  }  else if (mHitSentinel) {    FlushText();        nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());    nsIHTMLContent *content = nsnull;    result = NS_CreateHTMLElement(&content, nodeType);    if (NS_OK == result) {      result = AddAttributes(aNode, content);      if (NS_OK == result) {        nsIContent *parent = GetCurrentContent();                if (nsnull == parent) {          parent = mRoot;        }                parent->AppendChildTo(content, PR_FALSE);        PushContent(content);      }    }    if (nodeType == eHTMLTag_table        || nodeType == eHTMLTag_thead        || nodeType == eHTMLTag_tbody        || nodeType == eHTMLTag_tfoot        || nodeType == eHTMLTag_tr        || nodeType == eHTMLTag_td        || nodeType == eHTMLTag_th)      // XXX if navigator_quirks_mode (only body in html supports background)      AddBaseTagInfo(content);       }  return result;}