Re: [css3-flexbox] Children of flex items ignoring cross-axis percentage length

On Mon, Apr 7, 2014 at 10:36 AM, Daniel Holbert <dholbert@mozilla.com> wrote:
> Interesting.
>
> Here's a perhaps simpler case: suppose a vertical flex container has a
> flex item with "height: 10px; flex-basis: 50px", and that flex item has
> a child with a percent-valued height.
>
> Should the percent height resolve against the 10px specified-height, or
> against the flex-basis (which we can reliably know ahead of time is what
> its used height will end up resolving to)?
>
> Testcase: http://jsfiddle.net/LcL8U/
>
> CSS21 says this about percent height values:
>   # The percentage is calculated with respect to the
>   # height of the generated box's containing block.
>   # If the height of the containing block is not
>   # specified explicitly (i.e., it depends on content
>   # height), and this element is not absolutely
>   # positioned, the value computes to 'auto'."
> http://www.w3.org/TR/CSS21/visudet.html#propdef-height
>
> (We can disregard the second half of this spec text here, since there's
> clearly no dependence on content in my or Greg's example, and no browser
> seems to be treating the percent height as "auto".)

Sigh, bad application of errata strikes again!  (We errata'd that to
happen at used-value time instead.)

> So the question is, what is the "height of the box's containing block".
> Blink seems to be saying it's the specified "height" property, while
> Gecko/Trident are using the actual box's height (the flex basis). Since
> the CSS21 spec text [quoted above] seems to be talking about box height
> rather than the "height" property here, I tend to think the
> Gecko/Trident behavior is correct.

Yes, it's the actual height (the flex basis).  I think the spec is
clear about this, but I can correct something if it's not.

~TJ

Received on Wednesday, 9 April 2014 00:16:56 UTC