if (0 != finalDeltaY) {    mBlock->SlideLine(mPresContext, mSpaceManager, aLine, finalDeltaY);
mBlock->SlideLine(mPresContext, mSpaceManager, aLine, finalDeltaY);   if (aLine->mFloaters.NotEmpty()) {   nsRect r; nsFloaterCache* fc = aLine->mFloaters.Head(); while (fc) { fc->mRegion.y += finalDeltaY; fc->mCombinedArea.y += finalDeltaY; nsIFrame* floater = fc->mPlaceholder->GetOutOfFlowFrame(); floater->GetRect(r); floater->MoveTo(r.x, r.y + finalDeltaY); #ifdef NOISY_SPACEMANAGER nscoord tx, ty; mSpaceManager->GetTranslation(tx, ty); nsFrame::ListTag(stdout, mBlock); printf(": RecoverStateFrom: AddRectRegion: txy=%d,%d (%d,%d) {%d,%d,%d,%d}\n", tx, ty, mSpaceManagerX, mSpaceManagerY, fc->mRegion.x, fc->mRegion.y, fc->mRegion.width, fc->mRegion.height); #endif mSpaceManager->AddRectRegion(floater, fc->mRegion); fc = fc->Next(); }
nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine,                                     PRBool aApplyTopMargin,                                     nscoord aDeltaY,                                     nsRect* aDamageRect){  // Make the line being recovered the current line  mCurrentLine = aLine;  // Update aState.mPrevChild as if we had reflowed all of the frames  // in this line.  mPrevChild = aLine->LastChild();  // Recover mKidXMost and max element width  nscoord xmost = aLine->mBounds.XMost();  if (xmost > mKidXMost) {#ifdef DEBUG    if (CRAZY_WIDTH(xmost)) {      nsFrame::ListTag(stdout, mBlock);      printf(": WARNING: xmost:%d\n", xmost);    }#endif    mKidXMost = xmost;  }  if (mComputeMaxElementSize) {    UpdateMaxElementSize(nsSize(aLine->mMaxElementWidth, aLine->mBounds.height));  }  // The line may have clear before semantics.  if (NS_STYLE_CLEAR_NONE != aLine->mBreakType) {    // Clear past floaters before the block if the clear style is not none    aApplyTopMargin = ClearPastFloaters(aLine->mBreakType);  }  // Recover mPrevBottomMargin and calculate the line's new Y  // coordinate (newLineY)  nscoord newLineY = mY;  if (0 == aLine->mBounds.height) {    if (aLine->IsBlock() &&        nsBlockReflowContext::IsHTMLParagraph(aLine->mFirstChild)) {      // Empty HTML paragraphs disappear entirely - their margins go      // to zero.    }    else {      // The line's top and bottom margin values need to be collapsed      // with the mPrevBottomMargin to determine a new      // mPrevBottomMargin value.      nscoord topMargin, bottomMargin;      RecoverVerticalMargins(aLine, aApplyTopMargin,                             &topMargin, &bottomMargin);      nscoord m = nsBlockReflowContext::MaxMargin(topMargin, bottomMargin);      m = nsBlockReflowContext::MaxMargin(m, mPrevBottomMargin);      mPrevBottomMargin = m;    }  }  else {    // Recover the top and bottom margins for this line    nscoord topMargin, bottomMargin;    RecoverVerticalMargins(aLine, aApplyTopMargin,                           &topMargin, &bottomMargin);    // Compute the collapsed top margin value    nscoord collapsedTopMargin =      nsBlockReflowContext::MaxMargin(topMargin, mPrevBottomMargin);    // The lineY is just below the collapsed top margin value. The    // mPrevBottomMargin gets set to the bottom margin value for the    // line.    newLineY += collapsedTopMargin;    mPrevBottomMargin = bottomMargin;  }  nsRect  oldCombinedArea = aLine->mCombinedArea;  nscoord finalDeltaY = newLineY - aLine->mBounds.y;  if (0 != finalDeltaY) {    // Slide the frames in the line by the computed delta. This also    // updates the lines Y coordinate and the combined area's Y    // coordinate.    mBlock->SlideLine(mPresContext, mSpaceManager, aLine, finalDeltaY);  }  // Now that the line's Y coordinate is updated, place floaters back  // into the space manager  if (nsnull != aLine->mFloaters) {    mY = aLine->mBounds.y;    if (0 == aLine->mBounds.height) {      mY += mPrevBottomMargin;    }    PlaceCurrentLineFloaters(aLine->mFloaters);    mY = aLine->mBounds.YMost();    PlaceBelowCurrentLineFloaters(aLine->mFloaters, PR_FALSE);  }  // XXX Recover floater combined area  //   XXX not necessary at the moment because  //   PlaceCurrentLineFloaters and PlaceBelowCurrentLineFloaters  //   always reflow the floaters...  // Recover mY  mY = aLine->mBounds.YMost();  // Compute the damage area  // XXX Currently just use the union of the old and new combined area, but  // at some point we need to bitblt instead...  if (aDamageRect) {    if (0 == finalDeltaY) {      aDamageRect->Empty();    } else {      aDamageRect->UnionRect(oldCombinedArea, aLine->mCombinedArea);    }  }  // It's possible that the line has clear after semantics  if (!aLine->IsBlock() && (NS_STYLE_CLEAR_NONE != aLine->mBreakType)) {    switch (aLine->mBreakType) {    case NS_STYLE_CLEAR_LEFT:    case NS_STYLE_CLEAR_RIGHT:    case NS_STYLE_CLEAR_LEFT_AND_RIGHT:      ClearFloaters(mY, aLine->mBreakType);      break;    }  }}