if (!aParent || mFrameLoader) {
if (!mParent || !mDocument) {
nsHTMLIFrameElement::SetParent(nsIContent *aParent){  nsresult rv = nsGenericHTMLContainerElement::SetParent(aParent);  NS_ENSURE_SUCCESS(rv, rv);  // XXX if we're setting the parent to null, we don't bother with LoadSrc()  // just yet, because it will remove the frame loader--and our parent may get  // temporarily set to null if DemoteForm() is happening, we don't want to  // waste all that time.  // Also if mFrameLoader is already there, don't load again, for the same  // reason.  if (!aParent || mFrameLoader) {    return NS_OK;  }  return LoadSrc();}