rv = mCurrentContext->CloseContainer(aNode); MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseContainer()\n")); MOZ_TIMER_STOP(mWatch); return rv;
--mStackPos; nsHTMLTag nodeType = mStack[mStackPos].mType; nsIHTMLContent* content = mStack[mStackPos].mContent; content->Compact();   if (0 == (mStack[mStackPos].mFlags & APPENDED)) { NS_ASSERTION(mStackPos > 0, "container w/o parent"); if (mStackPos <= 0) { return NS_ERROR_FAILURE; } nsIHTMLContent* parent = mStack[mStackPos-1].mContent;   if (mStack[mStackPos-1].mInsertionPoint != -1) { result = parent->InsertChildAt(content, mStack[mStackPos-1].mInsertionPoint++, PR_FALSE); } else { result = parent->AppendChildTo(content, PR_FALSE); } }     if (mNotifyLevel >= mStackPos) { PRInt32 childCount;    content->ChildCount(childCount); if (mStack[mStackPos].mNumFlushed < childCount) { #ifdef NS_DEBUG  char cbuf[40]; const char* cp; nsAutoString str; nsCOMPtr<nsIDTD> dtd; mSink->mParser->GetDTD(getter_AddRefs(dtd)); dtd->IntTagToStringTag(nsHTMLTag(nodeType), str); cp = str.ToCString(cbuf, sizeof(cbuf));  SINK_TRACE(SINK_TRACE_REFLOW, ("SinkContext::CloseContainer: reflow on notifyImmediate tag=%s newIndex=%d stackPos=%d", cp, mStack[mStackPos].mNumFlushed, mStackPos)); #endif mSink->NotifyAppend(content, mStack[mStackPos].mNumFlushed); }   mNotifyLevel = mStackPos-1; }  if (mSink->IsMonolithicContainer(nodeType)) { --mSink->mInMonolithicContainer; }  DidAddContent(content, PR_FALSE);   switch (nodeType) {  case eHTMLTag_noembed: case eHTMLTag_noframes:  NS_ASSERTION((mSink->mInsideNoXXXTag > 0), "mInsideNoXXXTag underflow"); if (mSink->mInsideNoXXXTag > 0) { mSink->mInsideNoXXXTag--; } break;  case eHTMLTag_form: { nsHTMLTag parserNodeType = nsHTMLTag(aNode.GetNodeType());       if (parserNodeType != nodeType) { result = CloseContainer(aNode); } } break;  case eHTMLTag_iframe: mSink->mNumOpenIFRAMES--; break;  case eHTMLTag_select: { nsCOMPtr<nsISelectElement> select = do_QueryInterface(content, &result);  if (NS_SUCCEEDED(result)) { result = select->DoneAddingContent(PR_TRUE); } } break;  default: break;  }  NS_IF_RELEASE(content);  #ifdef DEBUG if (mPreAppend && SINK_LOG_TEST(gSinkLogModuleInfo,SINK_ALWAYS_REFLOW)) { mSink->ForceReflow(); } #endif  return result;
HTMLContentSink::CloseContainer(const nsIParserNode& aNode){  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::CloseContainer()\n"));  MOZ_TIMER_START(mWatch);  nsresult rv = NS_OK;  // XXX work around parser bug  if (eHTMLTag_frameset == aNode.GetNodeType()) {    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseContainer()\n"));    MOZ_TIMER_STOP(mWatch);    return CloseFrameset(aNode);  }  rv = mCurrentContext->CloseContainer(aNode);  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::CloseContainer()\n"));  MOZ_TIMER_STOP(mWatch);  return rv;}