if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) { PRBool clipState; aRenderingContext.PopState(clipState);
nsAutoString text; switch (myList->mListStyleType) { case NS_STYLE_LIST_STYLE_NONE: break;  default: case NS_STYLE_LIST_STYLE_BASIC: case NS_STYLE_LIST_STYLE_DISC: aRenderingContext.FillEllipse(mPadding.left, mPadding.top, mRect.width - (mPadding.left + mPadding.right), mRect.height - (mPadding.top + mPadding.bottom)); break;  case NS_STYLE_LIST_STYLE_CIRCLE: aRenderingContext.DrawEllipse(mPadding.left, mPadding.top, mRect.width - (mPadding.left + mPadding.right), mRect.height - (mPadding.top + mPadding.bottom)); break;  case NS_STYLE_LIST_STYLE_SQUARE: aRenderingContext.FillRect(mPadding.left, mPadding.top, mRect.width - (mPadding.left + mPadding.right), mRect.height - (mPadding.top + mPadding.bottom)); break;  case NS_STYLE_LIST_STYLE_DECIMAL: case NS_STYLE_LIST_STYLE_LOWER_ROMAN: case NS_STYLE_LIST_STYLE_UPPER_ROMAN: case NS_STYLE_LIST_STYLE_LOWER_ALPHA: case NS_STYLE_LIST_STYLE_UPPER_ALPHA: fm = aCX.GetMetricsFor(myFont->mFont); GetListItemText(aCX, *myList, text); aRenderingContext.SetFont(fm); aRenderingContext.GetWidth(text, width); aRenderingContext.DrawString(text, mPadding.left, mPadding.top, width); NS_RELEASE(fm); break;
nsBlockFrame::Paint(nsIPresContext&      aPresContext,                    nsIRenderingContext& aRenderingContext,                    const nsRect&        aDirtyRect){  const nsStyleDisplay* disp = (const nsStyleDisplay*)    mStyleContext->GetStyleData(eStyleStruct_Display);  if (disp->mVisible) {    PRIntn skipSides = GetSkipSides();    const nsStyleColor* color = (const nsStyleColor*)      mStyleContext->GetStyleData(eStyleStruct_Color);    const nsStyleSpacing* spacing = (const nsStyleSpacing*)      mStyleContext->GetStyleData(eStyleStruct_Spacing);    // Paint background and border    nsRect rect(0, 0, mRect.width, mRect.height);    nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,                                    aDirtyRect, rect, *color, 0, 0);    nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,                                aDirtyRect, rect, *spacing, skipSides);    // If overflow is hidden then set the clip rect so that children    // don't leak out of us    if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {      PRBool clipState;      aRenderingContext.PushState();      aRenderingContext.SetClipRect(nsRect(0, 0, mRect.width, mRect.height),                                    nsClipCombine_kIntersect, clipState);    }    PaintFloaters(aPresContext, aRenderingContext, aDirtyRect);    PaintChildren(aPresContext, aRenderingContext, aDirtyRect);    if (NS_STYLE_OVERFLOW_HIDDEN == disp->mOverflow) {      PRBool clipState;      aRenderingContext.PopState(clipState);    }  }  return NS_OK;}