nsLineBox* cursor = GetFirstLineContaining(aDirtyRect.y); line_iterator line_end = end_lines();  if (cursor) { for (line_iterator line = mLines.begin(cursor); line != line_end; ++line) { nsRect lineArea = line->GetCombinedArea(); if (!lineArea.IsEmpty()) {   if (lineArea.y >= aDirtyRect.YMost()) { break; } PaintLine(lineArea, aDirtyRect, line, depth, drawnLines, aPresContext, aRenderingContext, aWhichLayer, this); } } } else { PRBool nonDecreasingYs = PR_TRUE; PRInt32 lineCount = 0; nscoord lastY = PR_INT32_MIN; nscoord lastYMost = PR_INT32_MIN; for (line_iterator line = begin_lines(); line != line_end; ++line) { nsRect lineArea = line->GetCombinedArea(); if (!lineArea.IsEmpty()) { if (lineArea.y < lastY || lineArea.YMost() < lastYMost) { nonDecreasingYs = PR_FALSE; } lastY = lineArea.y; lastYMost = lineArea.YMost();  PaintLine(lineArea, aDirtyRect, line, depth, drawnLines, aPresContext, aRenderingContext, aWhichLayer, this); } lineCount++; }  if (nonDecreasingYs && lineCount >= MIN_LINES_NEEDING_CURSOR) { SetupLineCursor();
if ((nsnull == mPrevInFlow) && (nsnull != mBullet)) { const nsStyleList* list; GetStyleData(eStyleStruct_List, (const nsStyleStruct*&)list); if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == list->mListStylePosition) {  PaintChild(aPresContext, aRenderingContext, aDirtyRect, mBullet, PR_TRUE);
nsBlockFrame::PaintChildren(nsPresContext*      aPresContext,                            nsIRenderingContext& aRenderingContext,                            const nsRect&        aDirtyRect,                            nsFramePaintLayer    aWhichLayer,                            PRUint32             aFlags){  PRInt32 drawnLines; // Will only be used if set (gLamePaintMetrics).  PRInt32 depth = 0;#ifdef DEBUG  if (gNoisyDamageRepair) {    if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {      depth = GetDepth();    }  }  PRTime start = LL_ZERO; // Initialize these variables to silence the compiler.  if (gLamePaintMetrics) {    start = PR_Now();    drawnLines = 0;  }#endif  nsLineBox* cursor = GetFirstLineContaining(aDirtyRect.y);  line_iterator line_end = end_lines();  if (cursor) {    for (line_iterator line = mLines.begin(cursor);         line != line_end;         ++line) {      nsRect lineArea = line->GetCombinedArea();      if (!lineArea.IsEmpty()) {        // Because we have a cursor, the combinedArea.ys are non-decreasing.        // Once we've passed aDirtyRect.YMost(), we can never see it again.        if (lineArea.y >= aDirtyRect.YMost()) {          break;        }        PaintLine(lineArea, aDirtyRect, line, depth, drawnLines, aPresContext,                  aRenderingContext, aWhichLayer, this);      }    }  } else {    PRBool nonDecreasingYs = PR_TRUE;    PRInt32 lineCount = 0;    nscoord lastY = PR_INT32_MIN;    nscoord lastYMost = PR_INT32_MIN;    for (line_iterator line = begin_lines();         line != line_end;         ++line) {      nsRect lineArea = line->GetCombinedArea();      if (!lineArea.IsEmpty()) {        if (lineArea.y < lastY            || lineArea.YMost() < lastYMost) {          nonDecreasingYs = PR_FALSE;        }        lastY = lineArea.y;        lastYMost = lineArea.YMost();        PaintLine(lineArea, aDirtyRect, line, depth, drawnLines, aPresContext,                  aRenderingContext, aWhichLayer, this);      }      lineCount++;    }    if (nonDecreasingYs && lineCount >= MIN_LINES_NEEDING_CURSOR) {      SetupLineCursor();    }  }  if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {    if ((nsnull != mBullet) && HaveOutsideBullet()) {      // Paint outside bullets manually      PaintChild(aPresContext, aRenderingContext, aDirtyRect, mBullet,                 aWhichLayer);    }  }#ifdef DEBUG  if (gLamePaintMetrics) {    PRTime end = PR_Now();    PRInt32 numLines = mLines.size();    if (!numLines) numLines = 1;    PRTime lines, deltaPerLine, delta;    LL_I2L(lines, numLines);    LL_SUB(delta, end, start);    LL_DIV(deltaPerLine, delta, lines);    ListTag(stdout);    char buf[400];    PR_snprintf(buf, sizeof(buf),                ": %lld elapsed (%lld per line) lines=%d drawn=%d skip=%d",                delta, deltaPerLine,                numLines, drawnLines, numLines - drawnLines);    printf("%s\n", buf);  }#endif}