L. David Baron wrote:
I agree that this seems wrong for inlines, and that it should include
padding for blocks.  But for inlines, according to CSS2.1, it *should*
actually be based on the position of the inlines, not the blocks.

http://www.w3.org/TR/CSS21/visudet.html#containing-block-details

Right.  For an inline, we pass in aContainingBlockWidth -- see
<http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/generic/nsInlineFrame.cpp&rev=3.247.2.2&mark=1202-1205,1212#1200>. So I'd say maybe do something like:

  nscoord availWidth = aContainingBlockWidth;
  if (availWidth == -1) {
    NS_ASSERTION(aReflowState.mComputedWidth != NS_UNCONSTRAINEDSIZE,
                 "Must have a useful width _somewhere_");
    availWidth =
      aReflowState.mComputedWidth + aReflowState.mComputedPadding.LeftRight();
  }

and use that as the available width.  Seem reasonable?
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to