if (aPresContext->IsPaginated()) { if (aPresContext->IsRenderingOnlySelection()) {
PRBool isPaginated; aPresContext->IsPaginated(&isPaginated); if (isPaginated) { PRBool isRendingSelection; aPresContext->IsRenderingOnlySelection(&isRendingSelection); if (isRendingSelection) {
nsTextFrame::IsVisibleForPainting(nsPresContext *     aPresContext,                                   nsIRenderingContext& aRenderingContext,                                  PRBool               aCheckVis,                                  PRBool*              aIsVisible){  if (aCheckVis) {    if (!GetStyleVisibility()->IsVisible()) {      *aIsVisible = PR_FALSE;      return NS_OK;    }  }  // Start by assuming we are visible and need to be painted  PRBool isVisible = PR_TRUE;  if (aPresContext->IsPaginated()) {    if (aPresContext->IsRenderingOnlySelection()) {      // Check the quick way first      PRBool isSelected = (mState & NS_FRAME_SELECTED_CONTENT) == NS_FRAME_SELECTED_CONTENT;      if (isSelected) {        isVisible = IsTextInSelection(aPresContext, aRenderingContext);      } else {        isVisible = PR_FALSE;      }    }  }   *aIsVisible = isVisible;  return NS_OK;}