aDamageRect->UnionRect(oldCombinedArea, aLine->mCombinedArea);
aDamageRect->UnionRect(oldCombinedArea, lineCombinedArea);
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 (aLine->IsBlock() && aLine->HasBreak()) {    // Clear past floaters before the block if the clear style is not none    aApplyTopMargin = ClearPastFloaters(aLine->GetBreakType());#ifdef NOISY_VERTICAL_MARGINS    nsFrame::ListTag(stdout, mBlock);    printf(": RecoverStateFrom: y=%d child ", mY);    nsFrame::ListTag(stdout, aLine->mFirstChild);    printf(" has clear of %d => %s, mPrevBottomMargin=%d\n", aLine->mBreakType,           aApplyTopMargin ? "applyTopMargin" : "nope", mPrevBottomMargin);#endif  }  // Recover mPrevBottomMargin and calculate the line's new Y  // coordinate (newLineY)  nscoord newLineY = mY;  if ((0 == aLine->mBounds.height) && (0 == aLine->mCombinedArea.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(bottomMargin,                                                  mPrevBottomMargin);      m = nsBlockReflowContext::MaxMargin(m, topMargin);      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;  }  // Save away the old combined area for later  nsRect oldCombinedArea = aLine->mCombinedArea;  // Slide the frames in the line by the computed delta. This also  // updates the lines Y coordinate and the combined area's Y  // coordinate.  nscoord finalDeltaY = newLineY - aLine->mBounds.y;  mBlock->SlideLine(*this, aLine, finalDeltaY);  // Place floaters for this line into the space manager  if (aLine->mFloaters.NotEmpty()) {    // Undo border/padding translation since the nsFloaterCache's    // coordinates are relative to the frame not relative to the    // border/padding.    const nsMargin& bp = BorderPadding();    mSpaceManager->Translate(-bp.left, -bp.top);    // Place the floaters into the space-manager again. Also slide    // them, just like the regular frames on the line.    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();    }    // And then put the translation back again    mSpaceManager->Translate(bp.left, bp.top);  }  // Recover mY  mY = aLine->mBounds.YMost();  // Compute the damage area  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() && aLine->HasBreak()) {    PRUint8 breakType = aLine->GetBreakType();    switch (breakType) {    case NS_STYLE_CLEAR_LEFT:    case NS_STYLE_CLEAR_RIGHT:    case NS_STYLE_CLEAR_LEFT_AND_RIGHT:      ClearFloaters(mY, breakType);      break;    }  }}