mCurrentContext->SetPreAppend(PR_FALSE);
HTMLContentSink::OpenBody(const nsIParserNode& aNode){  MOZ_TIMER_DEBUGLOG(("Start: nsHTMLContentSink::OpenBody()\n"));  MOZ_TIMER_START(mWatch);  SINK_TRACE_NODE(SINK_TRACE_CALLS,                  "HTMLContentSink::OpenBody",                   eHTMLTag_body,                  mCurrentContext->mStackPos,                   this);  CloseHeadContext();  // do this just in case if the HEAD was left open!  // Add attributes, if any, to the current BODY node  if (mBody) {    AddAttributes(aNode, mBody, PR_TRUE, PR_TRUE);    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));    MOZ_TIMER_STOP(mWatch);    return NS_OK;  }  // Open body. Note that we pre-append the body to the root so that  // incremental reflow during document loading will work properly.  mCurrentContext->SetPreAppend(PR_TRUE);  nsresult rv = mCurrentContext->OpenContainer(aNode);  mCurrentContext->SetPreAppend(PR_FALSE);  if (NS_FAILED(rv)) {    MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));    MOZ_TIMER_STOP(mWatch);    return rv;  }  mBody = mCurrentContext->mStack[mCurrentContext->mStackPos - 1].mContent;  NS_ADDREF(mBody);  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::OpenBody()\n"));  MOZ_TIMER_STOP(mWatch);  if (mCurrentContext->mStackPos > 1) {    PRInt32 parentIndex    = mCurrentContext->mStackPos - 2;    nsGenericHTMLElement *parent = mCurrentContext->mStack[parentIndex].mContent;    PRInt32 numFlushed     = mCurrentContext->mStack[parentIndex].mNumFlushed;    PRInt32 insertionPoint =      mCurrentContext->mStack[parentIndex].mInsertionPoint;    // XXX: I have yet to see a case where numFlushed is non-zero and    // insertionPoint is not -1, but this code will try to handle    // those cases too.    if (insertionPoint != -1) {      NotifyInsert(parent, mBody, insertionPoint - 1);    } else {      NotifyAppend(parent, numFlushed);    }  }  StartLayout();  return NS_OK;}