PRBool isVisible; if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_TRUE, &isVisible)) && !isVisible) { return NS_OK;
PRBool isPaginated; aPresContext->IsPaginated(&isPaginated);  if (!isPaginated) { nsCOMPtr<nsIDocShell> docShell; GetDocShell(getter_AddRefs(docShell));  if (!docShell) { const nsStyleBackground* color = (const nsStyleBackground*)mStyleContext-> GetStyleData(eStyleStruct_Background);  aRenderingContext.SetColor(color->mBackgroundColor); aRenderingContext.FillRect(mRect); }
nsHTMLFrameOuterFrame::Paint(nsIPresContext*      aPresContext,                             nsIRenderingContext& aRenderingContext,                             const nsRect&        aDirtyRect,                             nsFramePaintLayer    aWhichLayer,                             PRUint32             aFlags){  PRBool isVisible;  if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_TRUE, &isVisible)) && !isVisible) {    return NS_OK;  }  //printf("outer paint %X (%d,%d,%d,%d) \n", this, aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);  nsIFrame* firstChild = mFrames.FirstChild();  if (nsnull != firstChild) {    firstChild->Paint(aPresContext, aRenderingContext, aDirtyRect,                      aWhichLayer);  }  if (IsInline()) {    return nsHTMLContainerFrame::Paint(aPresContext, aRenderingContext,                                       aDirtyRect, aWhichLayer);  } else {    return NS_OK;  }}