if (mDocument) { nsCOMPtr<nsIContent> rootContent; mDocument->GetRootContent(getter_AddRefs(rootContent));  if (!rootContent) { mDidInitialReflow = PR_FALSE; } }
if (mDocument && !mDocument->GetRootContent()) mDidInitialReflow = PR_FALSE;
PresShell::ContentRemoved(nsIDocument *aDocument,                          nsIContent* aContainer,                          nsIContent* aChild,                          PRInt32     aIndexInContainer){  // Notify the ESM that the content has been removed, so that  // it can clean up any state related to the content.  nsCOMPtr<nsIEventStateManager> esm;  mPresContext->GetEventStateManager(getter_AddRefs(esm));  if (esm)    esm->ContentRemoved(aChild);  WillCauseReflow();  nsresult  rv = mStyleSet->ContentRemoved(mPresContext, aContainer,                                           aChild, aIndexInContainer);  // If we have no root content node at this point, be sure to reset  // mDidInitialReflow to PR_FALSE, this will allow InitialReflow()  // to be called again should a new root node be inserted for this  // presShell. (Bug 167355)  if (mDocument) {    nsCOMPtr<nsIContent> rootContent;    mDocument->GetRootContent(getter_AddRefs(rootContent));    if (!rootContent) {      mDidInitialReflow = PR_FALSE;    }  }  VERIFY_STYLE_TREE;  DidCauseReflow();  return rv;}