aState.mY += aState.mPrevBottomMargin;
if ((NS_BODY_NO_AUTO_MARGINS & mFlags) && (NS_CARRIED_BOTTOM_MARGIN_IS_AUTO & aState.mPrevMarginFlags)) {   } else { aState.mY += aState.mPrevBottomMargin; }
nsBlockFrame::ComputeFinalSize(nsBlockReflowState&  aState,                               nsHTMLReflowMetrics& aMetrics){  // Compute final width  PRIntn ss = aState.mStyleSizeFlags;  if (NS_SIZE_HAS_WIDTH & ss) {    // Use style defined width    aMetrics.width = aState.mBorderPadding.left +      aState.mStyleSize.width + aState.mBorderPadding.right;  }  else {    // There are two options here. We either shrink wrap around our    // contents or we fluff out to the maximum available width. Note:    // We always shrink wrap when given an unconstrained width.    nscoord contentWidth = aState.mKidXMost + aState.mBorderPadding.right;    if (!mShrinkWrap && !aState.mUnconstrainedWidth) {      // Fluff out to the max width if we aren't already that wide      if (contentWidth < aState.maxSize.width) {        contentWidth = aState.maxSize.width;      }    }    aMetrics.width = contentWidth;  }  // Compute final height  if (NS_SIZE_HAS_HEIGHT & ss) {    // Use style defined height    aMetrics.height = aState.mBorderPadding.top +      aState.mStyleSize.height + aState.mBorderPadding.bottom;  }  else {    // Shrink wrap our height around our contents.    if (aState.mIsMarginRoot) {      // When we are a margin root make sure that our last childs      // bottom margin is fully applied.      aState.mY += aState.mPrevBottomMargin;    }    aState.mY += aState.mBorderPadding.bottom;    aMetrics.height = aState.mY;  }  // Return top and bottom margin information  if (aState.mIsMarginRoot) {    aMetrics.mCarriedOutTopMargin = 0;    aMetrics.mCarriedOutBottomMargin = 0;    aState.mCollapsedTopMargin = 0;  }  else {    aMetrics.mCarriedOutTopMargin = aState.mCollapsedTopMargin;    aMetrics.mCarriedOutBottomMargin = aState.mPrevBottomMargin;  }  // Special check for zero sized content: If our content is zero  // sized then we collapse into nothingness.  if ((NS_SIZE_HAS_BOTH != ss) &&      ((0 == aState.mKidXMost - aState.mBorderPadding.left) ||       (0 == aState.mY - aState.mBorderPadding.top))) {    aMetrics.width = 0;    aMetrics.height = 0;  }  aMetrics.ascent = aMetrics.height;  aMetrics.descent = 0;  // XXX this needs reworking I suppose  if (aState.mComputeMaxElementSize) {    *aMetrics.maxElementSize = aState.mMaxElementSize;    // Add in our border and padding to the max-element-size so that    // we don't shrink too far.    aMetrics.maxElementSize->width += aState.mBorderPadding.left +      aState.mBorderPadding.right;    aMetrics.maxElementSize->height += aState.mBorderPadding.top +      aState.mBorderPadding.bottom;    // Factor in any left and right floaters as well    LineData* line = mLines;    PRInt32 maxLeft = 0, maxRight = 0;    while (nsnull != line) {      if (nsnull != line->mFloaters) {        nsRect r;        nsMargin floaterMargin;        PRInt32 leftSum = 0, rightSum = 0;        PRInt32 n = line->mFloaters->Count();        for (PRInt32 i = 0; i < n; i++) {          nsPlaceholderFrame* placeholder = (nsPlaceholderFrame*)            line->mFloaters->ElementAt(i);          nsIFrame* floater = placeholder->GetAnchoredItem();          floater->GetRect(r);          const nsStyleDisplay* floaterDisplay;          const nsStyleSpacing* floaterSpacing;          floater->GetStyleData(eStyleStruct_Display,                                (const nsStyleStruct*&)floaterDisplay);          floater->GetStyleData(eStyleStruct_Spacing,                                (const nsStyleStruct*&)floaterSpacing);          floaterSpacing->CalcMarginFor(floater, floaterMargin);          nscoord width = r.width + floaterMargin.left + floaterMargin.right;          switch (floaterDisplay->mFloats) {          default:            NS_NOTYETIMPLEMENTED("Unsupported floater type");            // FALL THROUGH          case NS_STYLE_FLOAT_LEFT:            leftSum += width;            break;          case NS_STYLE_FLOAT_RIGHT:            rightSum += width;            break;          }        }        if (leftSum > maxLeft) maxLeft = leftSum;        if (rightSum > maxRight) maxRight = rightSum;      }      line = line->mNext;    }    aMetrics.maxElementSize->width += maxLeft + maxRight;  }}