nsBlockReflowState::ClearFloaters(PRUint8 aBreakType)
nsBlockReflowState::ClearFloaters(nscoord aY, PRUint8 aBreakType)
nsBlockReflowState::ClearFloaters(PRUint8 aBreakType){  // Update band information based on current mY before clearing  GetAvailableSpace();  for (;;) {    PRBool haveFloater = PR_FALSE;    // Find the Y coordinate to clear to. Note that the band trapezoid    // coordinates are relative to the our spacemanager translation    // (which means the band coordinates are inside the border+padding    // area of this block frame).    NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,       ("nsBlockReflowState::ClearFloaters: mY=%d trapCount=%d",        mY, mCurrentBand.count));    nscoord clearYMost = mY - mBorderPadding.top;    nsRect tmp;    PRInt32 i;    for (i = 0; i < mCurrentBand.count; i++) {      const nsStyleDisplay* display;      nsBandTrapezoid* trapezoid = &mCurrentBand.data[i];      NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,         ("nsBlockReflowState::ClearFloaters: trap=%d state=%d",          i, trapezoid->state));      if (nsBandTrapezoid::Available != trapezoid->state) {        haveFloater = PR_TRUE;        if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {          PRInt32 fn, numFrames = trapezoid->frames->Count();          NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");          for (fn = 0; fn < numFrames; fn++) {            nsIFrame* frame = (nsIFrame*) trapezoid->frames->ElementAt(fn);            frame->GetStyleData(eStyleStruct_Display,                                (const nsStyleStruct*&)display);            NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,               ("nsBlockReflowState::ClearFloaters: frame[%d]=%p floats=%d",                fn, frame, display->mFloats));            switch (display->mFloats) {            case NS_STYLE_FLOAT_LEFT:              if ((NS_STYLE_CLEAR_LEFT == aBreakType) ||                  (NS_STYLE_CLEAR_LEFT_AND_RIGHT == aBreakType)) {                trapezoid->GetRect(tmp);                nscoord ym = tmp.YMost();                if (ym > clearYMost) {                  clearYMost = ym;                }              }              break;            case NS_STYLE_FLOAT_RIGHT:              if ((NS_STYLE_CLEAR_RIGHT == aBreakType) ||                  (NS_STYLE_CLEAR_LEFT_AND_RIGHT == aBreakType)) {                trapezoid->GetRect(tmp);                nscoord ym = tmp.YMost();                if (ym > clearYMost) {                  clearYMost = ym;                  NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,                  ("nsBlockReflowState::ClearFloaters: right clearYMost=%d",                   clearYMost));                }              }              break;            }          }        }        else {          trapezoid->frame->GetStyleData(eStyleStruct_Display,                                         (const nsStyleStruct*&)display);          NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,             ("nsBlockReflowState::ClearFloaters: frame=%p floats=%d",              trapezoid->frame, display->mFloats));          switch (display->mFloats) {          case NS_STYLE_FLOAT_LEFT:            if ((NS_STYLE_CLEAR_LEFT == aBreakType) ||                (NS_STYLE_CLEAR_LEFT_AND_RIGHT == aBreakType)) {              trapezoid->GetRect(tmp);              nscoord ym = tmp.YMost();              if (ym > clearYMost) {                clearYMost = ym;                NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,                  ("nsBlockReflowState::ClearFloaters: left clearYMost=%d",                   clearYMost));              }            }            break;          case NS_STYLE_FLOAT_RIGHT:            if ((NS_STYLE_CLEAR_RIGHT == aBreakType) ||                (NS_STYLE_CLEAR_LEFT_AND_RIGHT == aBreakType)) {              trapezoid->GetRect(tmp);              nscoord ym = tmp.YMost();              if (ym > clearYMost) {                clearYMost = ym;                NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,                  ("nsBlockReflowState::ClearFloaters: right clearYMost=%d",                   clearYMost));              }            }            break;          }        }      }    }    // Nothing to clear    if (!haveFloater || (clearYMost == mY - mBorderPadding.top)) {      break;    }    NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,       ("nsBlockReflowState::ClearFloaters: mY=%d clearYMost=%d",        mY, clearYMost));    mY = mBorderPadding.top + clearYMost + 1;    // Get a new band    GetAvailableSpace();  }}