PR_FALSE);
PR_FALSE, PR_FALSE);
SinkContext::CloseContainer(const nsIParserNode& aNode){  nsresult result = NS_OK;  // Flush any collected text content. Release the last text  // node to indicate that no more should be added to it.  FlushTextAndRelease();    SINK_TRACE_NODE(SINK_TRACE_CALLS,                  "SinkContext::CloseContainer", aNode, mStackPos-1, mSink);  NS_WARN_IF_FALSE(mStackPos > 0,"stack out of bounds. wrong context probably!");  if(mStackPos<=0) {    return NS_OK; // Fix crash - Ref. bug 45975 or 45007  }  --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");    if (mStackPos <= 0) {      return NS_ERROR_FAILURE;    }    nsIHTMLContent* parent = mStack[mStackPos-1].mContent;    // If the parent has an insertion point, insert rather than    // append.    if (mStack[mStackPos-1].mInsertionPoint != -1) {      result = parent->InsertChildAt(content,                                      mStack[mStackPos-1].mInsertionPoint++,                                      PR_FALSE);    }    else {      result = parent->AppendChildTo(content, PR_FALSE);    }  }  // If we're in a state where we do append notifications as  // we go up the tree, and we're at the level where the next  // notification needs to be done, do the notification.  if (mNotifyLevel >= mStackPos) {    PRInt32 childCount;    // Check to see if new content has been added after our last    // notification    content->ChildCount(childCount);    if (mStack[mStackPos].mNumFlushed < childCount) {#ifdef NS_DEBUG      // Tracing code      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);    }    // Indicate that notification has now happened at this level    mNotifyLevel = mStackPos-1;  }  if (mSink->IsMonolithicContainer(nodeType)) {    --mSink->mInMonolithicContainer;  }  DidAddContent(content, PR_FALSE);  // Special handling for certain tags  switch (nodeType) {    case eHTMLTag_noembed:    case eHTMLTag_noframes:      // Fix bug 40216      NS_ASSERTION((mSink->mInsideNoXXXTag > 0), "mInsideNoXXXTag underflow");      if (mSink->mInsideNoXXXTag > 0) {        mSink->mInsideNoXXXTag--;      }      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 invalid form nesting. When the end FORM tag comes through,         // we'll ignore it.        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;}