Re: [css-flexbox][css-grid] Percentages resolving against definite max-height

On 05/11/15 01:27, Tab Atkins Jr. wrote:
> <http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3733>
> As far as we can tell, the max-height shouldn't matter here.  The
> available space in the vertical axis is infinite, so the item's %s
> should resolve to auto as specified in CSS 2.1, same as in block
> layout. <http://www.w3.org/TR/CSS21/visudet.html#the-height-property>
> <http://www.w3.org/TR/CSS21/visudet.html#min-max-heights>
> 
> But for some reason, both Chrome and Firefox agree that the items are
> 15px tall (modulo padding/etc).  This seems like reasonable, useful
> behavior, but we can't find a justification for it in the flex layout
> algorithm.
> 
> Can one of the implementors explain how they got this behavior?  We
> need to know where in the algo to spec this, so we can apply the same
> behavior to Grid.

This is something I brought up some time ago (here [1] and here [2]) but
it seems that it was not understood by that time.

My point was that for "normal" blocks a {min|max}-height restriction
only affect the block having that restriction. Children of those blocks
do not get re-laid out (see this example [3]), something that apparently
has to be done for grid [4], so it seems we have an inconsistency here.

I'm precisely working on improving the grid container sizing in Chromium
and Webkit so it'd be awesome to have a final resolution about this.

Note also that there are many tricky combinations once you add intrinsic
sizes to the equation like

<div style="display: grid; height: 20px; min-height: max-content">

<div style="display: grid; height: max-content; min-height: 10px">

where the track sizing (not only the grid container sizing) could be
totally different depending on whether we consider that the
{min|max}-{height|width} should be used to decide whether or not the
size is definite.

BR

PS: I'd love to spend some time reviewing the expected results for many
different combinations of these things. I've already created a test with
tons of different cases. It'd be awesome if any of the editors could
help, just contact me directly if you have some time available :).

[1] https://lists.w3.org/Archives/Public/www-style/2015Sep/0295.html
[2] https://lists.w3.org/Archives/Public/www-style/2015Sep/0317.html
[3] http://jsbin.com/cociwuvamo/edit?html,css,output
[4] https://lists.w3.org/Archives/Public/www-style/2015Sep/0297.html

Received on Thursday, 5 November 2015 09:57:54 UTC