On Thursday 2006-04-27 18:39 -0500, Boris Zbarsky wrote:
> 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?

Yep.

Although, given the two extra parameters this code passes to the reflow
state constructor, does this even matter?

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Attachment: pgpMQgQXf9gyw.pgp
Description: PGP signature

_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to