mStack[stackPos].mContent->GetTag(*getter_AddRefs(tag));
mStack[stackPos].mContent->GetTag(getter_AddRefs(tag));
SinkContext::FlushTags(PRBool aNotify){  nsresult result = NS_OK;  // Don't release last text node in case we need to add to it again  FlushText();  PRInt32 childCount;  nsIHTMLContent* content;  // Start from the top of the stack (growing upwards) and append  // all content that hasn't been previously appended to the tree  PRInt32 stackPos = mStackPos - 1;  while ((stackPos > 0) && ((mStack[stackPos].mFlags & APPENDED) == 0)) {    content = mStack[stackPos].mContent;    nsIHTMLContent* parent = mStack[stackPos - 1].mContent;    mStack[stackPos].mFlags |= APPENDED;    // If the parent has an insertion point, insert rather than    // append.    if (mStack[mStackPos - 1].mInsertionPoint != -1) {      parent->InsertChildAt(content, mStack[mStackPos - 1].mInsertionPoint++,                            PR_FALSE, PR_FALSE);    } else {      parent->AppendChildTo(content, PR_FALSE, PR_FALSE);    }    stackPos--;  }  if (aNotify) {    // Start from the base of the stack (growing upward) and do    // a notification from the node that is closest to the root of    // tree for any content that has been added.    stackPos = 1;    PRBool flushed = PR_FALSE;    while (stackPos < mStackPos) {      content = mStack[stackPos].mContent;      content->ChildCount(childCount);      if (!flushed && (mStack[stackPos].mNumFlushed < childCount)) {#ifdef NS_DEBUG        // Tracing code        nsCOMPtr<nsIAtom> tag;        mStack[stackPos].mContent->GetTag(*getter_AddRefs(tag));        const char* tagStr;        tag->GetUTF8String(&tagStr);        SINK_TRACE(SINK_TRACE_REFLOW,                   ("SinkContext::FlushTags: tag=%s from newindex=%d at "                    "stackPos=%d", tagStr,                    mStack[stackPos].mNumFlushed, stackPos));#endif        if ((mStack[stackPos].mInsertionPoint != -1) &&            (mStackPos > (stackPos + 1))) {          nsIContent* child = mStack[stackPos + 1].mContent;          mSink->NotifyInsert(content,                              child,                              mStack[stackPos].mInsertionPoint);        } else {          mSink->NotifyAppend(content, mStack[stackPos].mNumFlushed);        }        flushed = PR_TRUE;      }      mStack[stackPos].mNumFlushed = childCount;      stackPos++;    }    mNotifyLevel = mStackPos - 1;  }  return result;}