*getter_AddRefs(nodeInfo));
getter_AddRefs(nodeInfo));
HTMLContentSink::CreateContentObject(const nsIParserNode& aNode,                                     nsHTMLTag aNodeType,                                     nsIDOMHTMLFormElement* aForm,                                     nsIDocShell* aDocShell,                                     nsIHTMLContent** aResult){  nsresult rv = NS_OK;  // Find/create atom for the tag name  nsCOMPtr<nsINodeInfo> nodeInfo;  if (aNodeType == eHTMLTag_userdefined) {    nsAutoString tmp;    tmp.Append(aNode.GetText());    ToLowerCase(tmp);    rv = mNodeInfoManager->GetNodeInfo(tmp, nsnull, kNameSpaceID_None,                                       *getter_AddRefs(nodeInfo));  } else {    nsCOMPtr<nsIDTD> dtd;    rv = mParser->GetDTD(getter_AddRefs(dtd));    if (NS_SUCCEEDED(rv)) {      nsDependentString tag(dtd->IntTagToStringTag(aNodeType));      rv = mNodeInfoManager->GetNodeInfo(tag, nsnull, kNameSpaceID_None,                                         *getter_AddRefs(nodeInfo));    }  }  NS_ENSURE_SUCCESS(rv, rv);  // XXX if the parser treated the text in a textarea like a normal  // textnode we wouldn't need to do this.  if (aNodeType == eHTMLTag_textarea) {    nsCOMPtr<nsIDTD> dtd;    mParser->GetDTD(getter_AddRefs(dtd));    NS_ENSURE_TRUE(dtd, NS_ERROR_FAILURE);    PRInt32 lineNo = 0;    dtd->CollectSkippedContent(eHTMLTag_textarea, mSkippedContent, lineNo);  }  // Make the content object  rv = MakeContentObject(aNodeType, nodeInfo, aForm, aDocShell, aResult,                         !!mInsideNoXXXTag, PR_TRUE);  if (aNodeType == eHTMLTag_textarea && !mSkippedContent.IsEmpty()) {    // XXX: if the parser treated the text in a textarea like a normal    // textnode we wouldn't need to do this.    // If the text area has some content, set it    // Strip only one leading newline if there is one (bug 40394)    nsString::const_iterator start, end;    mSkippedContent.BeginReading(start);    mSkippedContent.EndReading(end);    if (*start == nsCRT::CR) {      ++start;      if (start != end && *start == nsCRT::LF) {        ++start;      }    } else if (*start == nsCRT::LF) {      ++start;    }    nsCOMPtr<nsIDOMHTMLTextAreaElement> ta(do_QueryInterface(*aResult));    NS_ASSERTION(ta, "Huh? text area doesn't implement "                 "nsIDOMHTMLTextAreaElement?");    ta->SetDefaultValue(Substring(start, end));    // Release whatever's in the skipped content string, no point in    // holding on to this any longer.    mSkippedContent.Truncate();  }  PRInt32 id;  mDocument->GetAndIncrementContentID(&id);  (*aResult)->SetContentID(id);  return rv;}