W3C home > Mailing lists > Public > www-style@w3.org > July 2014

[css-sizing][css-flexbox] intrinsic min/max-width/height values and percentage children

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 1 Jul 2014 09:33:20 -0700
Message-ID: <CAAWBYDDMBCMKXpj19LCp0VFr1Va9aKbz2Z7=WaOKkYLXLSsegA@mail.gmail.com>
To: www-style list <www-style@w3.org>
While reviewing this thread about flexbox percentage heights
<http://lists.w3.org/Archives/Public/www-style/2014Jun/0290.html> we
realized there's some interesting new interactions with the keywords
introduced by the Sizing module (and, indirectly, the
"min-height:auto" value introduced in Flexbox).

Previously, min/max-width/height was always a definite size: it didn't
depend on its contents.  (When it *would have* done so, such as
resolving a percentage min/max against an indefinite containing block
height, we instead reset it to its initial, definite, value.)
Therefore the min/max-width/height value on a parent didn't affect
whether it could resolve percentages on the child.

However, Sizing now adds min-content/max-content/etc keywords to
min/max-width/height, which are indefinite, intrinsic sizes, and
Flexbox's "min-width/height: auto" value implicitly relies on
min-content sizing as well. This means that a percentage-sized child
could be trying to resolve against an intrinsic size even when
'width/height' itself is definite.

What should happen in such a situation?

A. Have the percentage child size as for 'auto', as for intrinsic
'width/height' values on the parent? (This means that, by default,
percentage heights will never work on children of flex items, since
flex items have a default min-size calculation involving the
min-content height.)
B. Ignore the potential effects of the min/max size when resolve the
percentage? (This means the child may underflow/overflow the flex
item.)
C. Do a two-pass layout? (We already do this in some cases, like
percentage cross-sizes resolved against an indefinite flex container.
But note that stacked 2-pass layouts are O(n^2).)
D. Something else?

~TJ and fantasai
Received on Tuesday, 1 July 2014 16:34:06 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:42 UTC