DISPLAY_REFLOW(this, aReflowState, aMetrics, aStatus);
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
BRFrame::Reflow(nsIPresContext* aPresContext,                nsHTMLReflowMetrics& aMetrics,                const nsHTMLReflowState& aReflowState,                nsReflowStatus& aStatus){  DO_GLOBAL_REFLOW_COUNT("BRFrame", aReflowState.reason);  DISPLAY_REFLOW(this, aReflowState, aMetrics, aStatus);  if (aMetrics.maxElementSize) {    aMetrics.maxElementSize->width = 0;    aMetrics.maxElementSize->height = 0;  }  aMetrics.height = 0; // BR frames with height 0 are ignored in quirks                       // mode by nsLineLayout::VerticalAlignFrames .                       // However, it's not always 0.  See below.  aMetrics.width = 0;  aMetrics.ascent = 0;  aMetrics.descent = 0;  // Only when the BR is operating in a line-layout situation will it  // behave like a BR.  nsLineLayout* ll = aReflowState.mLineLayout;  if (ll) {    if ( ll->CanPlaceFloaterNow() || ll->InStrictMode() ) {      // If we can place a floater on the line now it means that the      // line is effectively empty (there may be zero sized compressed      // white-space frames on the line, but they are to be ignored).      //      // If this frame is going to terminate the line we know      // that nothing else will go on the line. Therefore, in this      // case, we provide some height for the BR frame so that it      // creates some vertical whitespace.  It's necessary to use the      // line-height rather than the font size because the      // quirks-mode fix that doesn't apply the block's min      // line-height makes this necessary to make BR cause a line      // of the full line-height      // We also do this in strict mode because BR should act like a      // normal inline frame.  That line-height is used is important      // here for cases where the line-height is less that 1.      const nsStyleFont* font = (const nsStyleFont*)        mStyleContext->GetStyleData(eStyleStruct_Font);      aReflowState.rendContext->SetFont(font->mFont);      nsCOMPtr<nsIFontMetrics> fm;      aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm));      if (fm) {        nscoord ascent, descent;        fm->GetMaxAscent(ascent);        fm->GetMaxDescent(descent);        nscoord logicalHeight =          aReflowState.CalcLineHeight(aPresContext,                                       aReflowState.rendContext,                                       this);        nscoord leading = logicalHeight - ascent - descent;        aMetrics.height = logicalHeight;        aMetrics.ascent = ascent + (leading/2);        aMetrics.descent = logicalHeight - aMetrics.ascent;                      // = descent + (leading/2), but without rounding error      }      else {        aMetrics.ascent = aMetrics.height = 0;      }      // XXX temporary until I figure out a better solution; see the      // code in nsLineLayout::VerticalAlignFrames that zaps minY/maxY      // if the width is zero.      // XXX This also fixes bug 10036!      aMetrics.width = 1;      // Update max-element-size to keep us honest      if (aMetrics.maxElementSize) {        if (aMetrics.width > aMetrics.maxElementSize->width) {          aMetrics.maxElementSize->width = aMetrics.width;        }        if (aMetrics.height > aMetrics.maxElementSize->height) {          aMetrics.maxElementSize->height = aMetrics.height;        }      }    }    // Return our reflow status    PRUint32 breakType = aReflowState.mStyleDisplay->mBreakType;    if (NS_STYLE_CLEAR_NONE == breakType) {      breakType = NS_STYLE_CLEAR_LINE;    }    aStatus = NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |      NS_INLINE_MAKE_BREAK_TYPE(breakType);    ll->SetLineEndsInBR(PR_TRUE);  }  else {    aStatus = NS_FRAME_COMPLETE;  }  return NS_OK;}