printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
PRINTF("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));
nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,                                       nsIPresContext* aPresContext,                                       nsBlockFrame* aFrame,                                       const nsHTMLReflowMetrics& aMetrics,                                       PRBool aBlockMarginRoot)  : mBlock(aFrame),    mPresContext(aPresContext),    mReflowState(aReflowState),    mNextRCFrame(nsnull),    mPrevBottomMargin(0),    mLineNumber(0),    mFlags(0){  const nsMargin& borderPadding = BorderPadding();  if (aBlockMarginRoot) {    SetFlag(BRS_ISTOPMARGINROOT, PR_TRUE);    SetFlag(BRS_ISBOTTOMMARGINROOT, PR_TRUE);  }  if (0 != aReflowState.mComputedBorderPadding.top) {    SetFlag(BRS_ISTOPMARGINROOT, PR_TRUE);  }  if (0 != aReflowState.mComputedBorderPadding.bottom) {    SetFlag(BRS_ISBOTTOMMARGINROOT, PR_TRUE);  }  if (GetFlag(BRS_ISTOPMARGINROOT)) {    SetFlag(BRS_APPLYTOPMARGIN, PR_TRUE);  }    mSpaceManager = aReflowState.mSpaceManager;  NS_ASSERTION( nsnull != mSpaceManager, "SpaceManager should be set in nsBlockReflowState" );  if( nsnull != mSpaceManager ) {    // Translate into our content area and then save the     // coordinate system origin for later.    mSpaceManager->Translate(borderPadding.left, borderPadding.top);    mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);  }  mReflowStatus = NS_FRAME_COMPLETE;  mPresContext = aPresContext;  mBlock->GetNextInFlow((nsIFrame**)&mNextInFlow);  mKidXMost = 0;  // Compute content area width (the content area is inside the border  // and padding)  if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedWidth) {    mContentArea.width = aReflowState.mComputedWidth;  }  else {    if (NS_UNCONSTRAINEDSIZE == aReflowState.availableWidth) {      mContentArea.width = NS_UNCONSTRAINEDSIZE;      SetFlag(BRS_UNCONSTRAINEDWIDTH, PR_TRUE);    }    else if (NS_UNCONSTRAINEDSIZE != aReflowState.mComputedMaxWidth) {      // Choose a width based on the content (shrink wrap width) up      // to the maximum width      // Part 2 of a possible fix for 38157#ifdef FIX_BUG_38157      const nsMargin& margin = Margin();      nscoord availContentWidth = aReflowState.availableWidth;      if (NS_UNCONSTRAINEDSIZE != availContentWidth) {        availContentWidth -= (borderPadding.left + borderPadding.right) +                             (margin.left + margin.right);      }             mContentArea.width = PR_MIN(aReflowState.mComputedMaxWidth, availContentWidth);#else      mContentArea.width = aReflowState.mComputedMaxWidth;#endif      SetFlag(BRS_SHRINKWRAPWIDTH, PR_TRUE);    }    else {      nscoord lr = borderPadding.left + borderPadding.right;      mContentArea.width = aReflowState.availableWidth - lr;    }  }  mHaveRightFloaters = PR_FALSE;  // Compute content area height. Unlike the width, if we have a  // specified style height we ignore it since extra content is  // managed by the "overflow" property. When we don't have a  // specified style height then we may end up limiting our height if  // the availableHeight is constrained (this situation occurs when we  // are paginated).  if (NS_UNCONSTRAINEDSIZE != aReflowState.availableHeight) {    // We are in a paginated situation. The bottom edge is just inside    // the bottom border and padding. The content area height doesn't    // include either border or padding edge.    mBottomEdge = aReflowState.availableHeight - borderPadding.bottom;    mContentArea.height = mBottomEdge - borderPadding.top;  }  else {    // When we are not in a paginated situation then we always use    // an constrained height.    SetFlag(BRS_UNCONSTRAINEDHEIGHT, PR_TRUE);    mContentArea.height = mBottomEdge = NS_UNCONSTRAINEDSIZE;  }  mY = borderPadding.top;  mBand.Init(mSpaceManager, mContentArea);  mPrevChild = nsnull;  mCurrentLine = nsnull;  mPrevLine = nsnull;  const nsStyleText* styleText;  mBlock->GetStyleData(eStyleStruct_Text,                       (const nsStyleStruct*&) styleText);  switch (styleText->mWhiteSpace) {  case NS_STYLE_WHITESPACE_PRE:  case NS_STYLE_WHITESPACE_NOWRAP:    SetFlag(BRS_NOWRAP, PR_TRUE);    break;  default:    SetFlag(BRS_NOWRAP, PR_FALSE);    break;  }  SetFlag(BRS_COMPUTEMAXELEMENTSIZE, (nsnull != aMetrics.maxElementSize));#ifdef NOISY_MAX_ELEMENT_SIZE  printf("BRS: setting compute-MES to %d\n", (nsnull != aMetrics.maxElementSize));#endif  mMaxElementSize.SizeTo(0, 0);  SetFlag(BRS_COMPUTEMAXWIDTH,           (NS_REFLOW_CALC_MAX_WIDTH == (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH)));  mMaximumWidth = 0;  mMinLineHeight = nsHTMLReflowState::CalcLineHeight(mPresContext,                                                     aReflowState.rendContext,                                                     aReflowState.frame);}