NS_ASSERTION(nsnull != mCurrentLine, "null ptr"); if (nsnull == mCurrentLine->mFloaters) { mCurrentLine->mFloaters = new nsVoidArray();
const nsReflowState* rs = &aReflowState; while (nsnull != rs) { if (rs->frame == this) { break; } rs = rs->parentReflowState;
nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder){  // Update the current line's floater array  NS_ASSERTION(nsnull != mCurrentLine, "null ptr");  if (nsnull == mCurrentLine->mFloaters) {    mCurrentLine->mFloaters = new nsVoidArray();  }  mCurrentLine->mFloaters->AppendElement(aPlaceholder);  // Now place the floater immediately if possible. Otherwise stash it  // away in mPendingFloaters and place it later.  if (0 == mLineLayout.GetPlacedFrames()) {    NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,       ("nsBlockReflowState::AddFloater: IsLeftMostChild, placeHolder=%p",        aPlaceholder));    // Because we are in the middle of reflowing a placeholder frame    // within a line (and possibly nested in an inline frame or two    // that's a child of our block) we need to restore the space    // manager's translation to the space that the block resides in    // before placing the floater.    PRBool isLeftFloater;    nscoord ox, oy;    mSpaceManager->GetTranslation(ox, oy);    nscoord dx = ox - mSpaceManagerX;    nscoord dy = oy - mSpaceManagerY;    mSpaceManager->Translate(-dx, -dy);    PlaceFloater(aPlaceholder, isLeftFloater);    // Pass on updated available space to the current inline reflow engine    GetAvailableSpace();    mLineLayout.UpdateInlines(mCurrentBand.availSpace.x + mBorderPadding.left,                              mY,                              mCurrentBand.availSpace.width,                              mCurrentBand.availSpace.height,                              isLeftFloater);    // Restore coordinate system    mSpaceManager->Translate(dx, dy);  }  else {    // This floater will be placed after the line is done (it is a    // below current line floater).    NS_FRAME_LOG(NS_FRAME_TRACE_CHILD_REFLOW,       ("nsBlockReflowState::AddFloater: pending, placeHolder=%p",        aPlaceholder));    mPendingFloaters.AppendElement(aPlaceholder);  }}