MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::AddComment()\n")); MOZ_TIMER_STOP(mWatch);
if (!mSink) { return NS_ERROR_UNEXPECTED; }  nsCOMPtr<nsIContent> comment; nsresult rv = NS_NewCommentNode(getter_AddRefs(comment)); NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIDOMComment> domComment(do_QueryInterface(comment)); NS_ENSURE_TRUE(domComment, NS_ERROR_UNEXPECTED);  domComment->AppendData(aNode.GetText());  comment->SetDocument(mSink->mDocument, PR_FALSE, PR_TRUE);  nsIHTMLContent* parent; if (!mSink->mBody && !mSink->mFrameset && mSink->mHead) { parent = mSink->mHead; } else { parent = mStack[mStackPos - 1].mContent; }   if (mStack[mStackPos - 1].mInsertionPoint != -1) { parent->InsertChildAt(comment, mStack[mStackPos - 1].mInsertionPoint++, PR_FALSE, PR_FALSE); } else { parent->AppendChildTo(comment, PR_FALSE, PR_FALSE); }  DidAddContent(comment, PR_FALSE);  #ifdef DEBUG if (mPreAppend && SINK_LOG_TEST(gSinkLogModuleInfo, SINK_ALWAYS_REFLOW)) { mSink->ForceReflow(); } #endif
HTMLContentSink::AddComment(const nsIParserNode& aNode){  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::AddComment()\n"));  MOZ_TIMER_START(mWatch);  nsresult rv = mCurrentContext->AddComment(aNode);  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::AddComment()\n"));  MOZ_TIMER_STOP(mWatch);  return rv;}