nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE);
nsCOMPtr<nsIAtom> contentParentAtom = do_GetAtom("contentParent"); nsIFrame* contentParent = nsnull; nsCOMPtr<nsIPresShell> presShell; aPresContext->GetShell(getter_AddRefs(presShell));  if (presShell) { nsCOMPtr<nsIFrameManager> frameManager; presShell->GetFrameManager(getter_AddRefs(frameManager));  if (frameManager) { void* value; rv = frameManager->GetFrameProperty(this, contentParentAtom, NS_IFRAME_MGR_REMOVE_PROP, &value); if (NS_SUCCEEDED(rv)) { contentParent = (nsIFrame*)value; } } }  nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,contentParent,PR_TRUE);
nsHTMLFrameOuterFrame::Init(nsIPresContext*  aPresContext,                            nsIContent*      aContent,                            nsIFrame*        aParent,                            nsIStyleContext* aContext,                            nsIFrame*        aPrevInFlow){  mPresContext = aPresContext;  // determine if we are a <frame> or <iframe>  if (aContent) {    nsCOMPtr<nsIDOMHTMLFrameElement> frameElem = do_QueryInterface(aContent);    mIsInline = frameElem ? PR_FALSE : PR_TRUE;  }  nsresult rv =  nsHTMLFrameOuterFrameSuper::Init(aPresContext, aContent, aParent,                                                  aContext, aPrevInFlow);  if (NS_FAILED(rv))    return rv;  // nsHTMLFrameInnerFrame is going to create a view for its frame  // right away, in the call to Init().  If we need a view for the  // OuterFrame but we wait for the normal view creation path in  // nsCSSFrameConstructor, then we will lose because the InnerFrame's  // view's parent will already have been set to some outer view  // (e.g., the canvas) when it really needs to have the OuterFrame's  // view as its parent. So, create the OuterFrame's view right away  // if we need it, and the InnerFrame's view will get it as the parent.  nsIView* view = nsnull;  GetView(aPresContext, &view);  if (!view) {    nsHTMLContainerFrame::CreateViewForFrame(aPresContext,this,mStyleContext,nsnull,PR_TRUE);     GetView(aPresContext, &view);  }  const nsStyleDisplay* disp;  aParent->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)disp));  if (disp->mDisplay == NS_STYLE_DISPLAY_DECK) {    nsCOMPtr<nsIWidget> widget;    view->GetWidget(*getter_AddRefs(widget));    if (!widget)      view->CreateWidget(kCChildCID);  }  nsCOMPtr<nsIPresShell> shell;  aPresContext->GetShell(getter_AddRefs(shell));  nsIFrame* firstChild = new (shell.get()) nsHTMLFrameInnerFrame;  if (firstChild) {    mFrames.SetFrames(firstChild);    // Resolve the style context for the inner frame    nsresult rv = NS_OK;    nsIStyleContext *innerStyleContext = nsnull;    rv = aPresContext->ResolveStyleContextFor(mContent, mStyleContext,                                              &innerStyleContext);    if (NS_SUCCEEDED(rv)) {      rv = firstChild->Init(aPresContext, mContent, this, innerStyleContext, nsnull);      // have to release the context: Init does its own AddRef...      NS_RELEASE(innerStyleContext);    } else {      NS_WARNING( "Error resolving style for InnerFrame in nsHTMLFrameOuterFrame");    }    if (NS_FAILED(rv)){      NS_WARNING( "Error initializing InnerFrame in nsHTMLFrameOuterFrame");      return rv;    }  } else {    NS_WARNING("no memory allocating inner frame in nsHTMLFrameOuterFrame");    return NS_ERROR_OUT_OF_MEMORY;  }  return NS_OK;}