return Rebuild(mRoot);
NS_PRECONDITION(aElement != nsnull, "null ptr"); if (! aElement) return NS_ERROR_NULL_POINTER;  nsresult rv;      nsCOMPtr<nsIXULContent> xulcontent = do_QueryInterface(aElement);  if (xulcontent) { PRBool containerContentsBuilt = PR_FALSE; xulcontent->GetLazyState(nsIXULContent::eContainerContentsBuilt, containerContentsBuilt);  if (! containerContentsBuilt) return NS_OK; }    rv = RemoveGeneratedContent(aElement); if (NS_FAILED(rv)) return rv;  if (aElement == mRoot) {  mContentSupportMap.Clear(); mTemplateMap.Clear(); mConflictSet.Clear();  rv = CompileRules(); if (NS_FAILED(rv)) return rv; }    if (xulcontent) { xulcontent->SetLazyState(nsIXULContent::eChildrenMustBeRebuilt); xulcontent->ClearLazyState(nsIXULContent::eTemplateContentsBuilt); xulcontent->ClearLazyState(nsIXULContent::eContainerContentsBuilt); }    nsCOMPtr<nsIContent> container; PRInt32 newIndex; CreateTemplateAndContainerContents(aElement, getter_AddRefs(container), &newIndex);  if (container) { nsCOMPtr<nsIDocument> doc; mRoot->GetDocument(*getter_AddRefs(doc)); NS_ASSERTION(doc != nsnull, "root element has no document"); if (! doc) return NS_ERROR_UNEXPECTED;  doc->ContentAppended(container, newIndex); }  return NS_OK;
nsXULContentBuilder::Rebuild(){    return Rebuild(mRoot);}