RAPTOR_STOPWATCH_DEBUGTRACE(("Stop: nsHTMLContentSink::SetTitle()\n"));
HTMLContentSink::SetTitle(const nsString& aValue){  NS_START_STOPWATCH(mWatch)  NS_ASSERTION(mCurrentContext == mHeadContext, "SetTitle not in head");  if (nsnull == mTitle) {    mTitle = new nsString(aValue);  }  else {    // If the title was already set then don't try to overwrite it    // when a new title is encountered - For backwards compatiblity    //*mTitle = aValue;    NS_STOP_STOPWATCH(mWatch)    return NS_OK;  }  ReduceEntities(*mTitle);  mTitle->CompressWhitespace(PR_TRUE, PR_TRUE);  mHTMLDocument->SetTitle(*mTitle);  nsIAtom* atom = NS_NewAtom("title");  nsIHTMLContent* it = nsnull;  nsresult rv = NS_NewHTMLTitleElement(&it, atom);  if (NS_OK == rv) {    nsIContent* text;    rv = NS_NewTextNode(&text);    if (NS_OK == rv) {      nsIDOMText* tc;      rv = text->QueryInterface(kIDOMTextIID, (void**)&tc);      if (NS_OK == rv) {        tc->SetData(aValue);        NS_RELEASE(tc);      }      it->AppendChildTo(text, PR_FALSE);      text->SetDocument(mDocument, PR_FALSE);      NS_RELEASE(text);    }    mHead->AppendChildTo(it, PR_FALSE);    NS_RELEASE(it);  }  NS_RELEASE(atom);  NS_STOP_STOPWATCH(mWatch)  return NS_OK;}