nsresult result = NS_OK; FlushText();  SINK_TRACE_NODE(SINK_TRACE_CALLS, "SinkContext::CloseContainer", aNode);  --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"); nsIHTMLContent* parent = mStack[mStackPos-1].mContent; result = parent->AppendChildTo(content, PR_FALSE);
NS_START_STOPWATCH(mWatch) nsresult rv = NS_OK;  if (eHTMLTag_frameset == aNode.GetNodeType()) { NS_STOP_STOPWATCH(mWatch) return CloseFrameset(aNode);
SinkContext::CloseContainer(const nsIParserNode& aNode){  nsresult result = NS_OK;  FlushText();  SINK_TRACE_NODE(SINK_TRACE_CALLS,                  "SinkContext::CloseContainer", aNode);  --mStackPos;  nsHTMLTag nodeType = mStack[mStackPos].mType;  nsIHTMLContent* content = mStack[mStackPos].mContent;  content->Compact();  // Add container to its parent if we haven't already done it  if (0 == (mStack[mStackPos].mFlags & APPENDED)) {    NS_ASSERTION(mStackPos > 0, "container w/o parent");    nsIHTMLContent* parent = mStack[mStackPos-1].mContent;    result = parent->AppendChildTo(content, PR_FALSE);  }  NS_IF_RELEASE(content);  // Special handling for certain tags  switch (nodeType) {  case eHTMLTag_table:    mSink->mInMonolithicContainer--;    break;  case eHTMLTag_form:    {      nsHTMLTag parserNodeType = nsHTMLTag(aNode.GetNodeType());            // If there's a FORM on the stack, but this close tag doesn't      // close the form, then close out the form *and* close out the      // next container up. This is since the parser doesn't do fix up      // of forms. When the end FORM tag comes through, we'll ignore      // it.      if (parserNodeType != nodeType) {        result = CloseContainer(aNode);      }    }    break;  case eHTMLTag_iframe:    mSink->mNumOpenIFRAMES--;    break;  default:    break;  }  // Mark sink dirty if it can safely reflow something  MaybeMarkSinkDirty();#ifdef DEBUG  if (mPreAppend && mSink->mDirty &&      SINK_LOG_TEST(gSinkLogModuleInfo,SINK_ALWAYS_REFLOW)) {    mSink->ForceReflow();  }#endif  return result;}