borderStyle->GetBorder(b);
spacing->GetBorder(b);
nsBlockReflowState::ComputeBlockAvailSpace(nsIFrame* aFrame,                                           nsSplittableType aSplitType,                                           const nsStyleDisplay* aDisplay,                                           nsRect& aResult){#ifdef REALLY_NOISY_REFLOW  printf("CBAS frame=%p has floater count %d\n", aFrame, mBand.GetFloaterCount());  mBand.List();#endif  aResult.y = mY;  aResult.height = GetFlag(BRS_UNCONSTRAINEDHEIGHT)    ? NS_UNCONSTRAINEDSIZE    : mBottomEdge - mY;  const nsMargin& borderPadding = BorderPadding();  /* bug 18445: treat elements mapped to display: block such as text controls   * just like normal blocks   */  PRBool treatAsNotSplittable=PR_FALSE;  nsCOMPtr<nsIAtom>frameType;  aFrame->GetFrameType(getter_AddRefs(frameType));  if (frameType) {    // text controls are not splittable, so make a special case here    // XXXldb Why not just set the frame state bit?    if (nsLayoutAtoms::textInputFrame == frameType.get())      treatAsNotSplittable = PR_TRUE;  }  if (NS_FRAME_SPLITTABLE_NON_RECTANGULAR == aSplitType ||    // normal blocks       NS_FRAME_NOT_SPLITTABLE == aSplitType ||                // things like images mapped to display: block      PR_TRUE == treatAsNotSplittable)                        // text input controls mapped to display: block (special case)  {    if (mBand.GetFloaterCount()) {      // Use the float-edge property to determine how the child block      // will interact with the floater.      const nsStyleBorder* borderStyle;      aFrame->GetStyleData(eStyleStruct_Border,                           (const nsStyleStruct*&) borderStyle);      switch (borderStyle->mFloatEdge) {        default:        case NS_STYLE_FLOAT_EDGE_CONTENT:  // content and only content does runaround of floaters          // The child block will flow around the floater. Therefore          // give it all of the available space.          aResult.x = borderPadding.left;          aResult.width = GetFlag(BRS_UNCONSTRAINEDWIDTH)            ? NS_UNCONSTRAINEDSIZE            : mContentArea.width;           break;        case NS_STYLE_FLOAT_EDGE_BORDER:         case NS_STYLE_FLOAT_EDGE_PADDING:          {            // The child block's border should be placed adjacent to,            // but not overlap the floater(s).            nsMargin m(0, 0, 0, 0);            const nsStyleMargin* styleMargin;            aFrame->GetStyleData(eStyleStruct_Margin,                                 (const nsStyleStruct*&) styleMargin);            styleMargin->GetMargin(m); // XXX percentage margins            if (NS_STYLE_FLOAT_EDGE_PADDING == borderStyle->mFloatEdge) {              // Add in border too              nsMargin b;              borderStyle->GetBorder(b);              m += b;            }            // determine left edge            if (mBand.GetLeftFloaterCount()) {              aResult.x = mAvailSpaceRect.x + borderPadding.left - m.left;            }            else {              aResult.x = borderPadding.left;            }            // determine width            if (GetFlag(BRS_UNCONSTRAINEDWIDTH)) {              aResult.width = NS_UNCONSTRAINEDSIZE;            }            else {              if (mBand.GetRightFloaterCount()) {                if (mBand.GetLeftFloaterCount()) {                  aResult.width = mAvailSpaceRect.width + m.left + m.right;                }                else {                  aResult.width = mAvailSpaceRect.width + m.right;                }              }              else {                aResult.width = mAvailSpaceRect.width + m.left;              }            }          }          break;        case NS_STYLE_FLOAT_EDGE_MARGIN:          {            // The child block's margins should be placed adjacent to,            // but not overlap the floater.            aResult.x = mAvailSpaceRect.x + borderPadding.left;            aResult.width = mAvailSpaceRect.width;          }          break;      }    }    else {      // Since there are no floaters present the float-edge property      // doesn't matter therefore give the block element all of the      // available space since it will flow around the floater itself.      aResult.x = borderPadding.left;      aResult.width = GetFlag(BRS_UNCONSTRAINEDWIDTH)        ? NS_UNCONSTRAINEDSIZE        : mContentArea.width;    }  }  else {    // The frame is clueless about the space manager and therefore we    // only give it free space. An example is a table frame - the    // tables do not flow around floaters.    aResult.x = mAvailSpaceRect.x + borderPadding.left;    aResult.width = mAvailSpaceRect.width;  }#ifdef REALLY_NOISY_REFLOW  printf("  CBAS: result %d %d %d %d\n", aResult.x, aResult.y, aResult.width, aResult.height);#endif}