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

Re: [css3-writing-modes] height: fill-available's behavior is suboptimal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 13 Jul 2012 15:22:19 -0700
Message-ID: <CAAWBYDB-+b0vhvhq247nB0H0CEya+sJMdzUdmB-eu-yVSOM1vw@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: "L. David Baron" <dbaron@dbaron.org>, Elliott Sprehn <esprehn@gmail.com>, www-style list <www-style@w3.org>
On Fri, Jul 13, 2012 at 1:56 PM, Ojan Vafai <ojan@chromium.org> wrote:
> I'm torn on the special-casing of *-content. In the block direction,
> *-content are defined as being equivalent to auto, so they should go down
> the auto codepath in your algorithm regardless. In the inline direction, I'm
> thinking of the following case:
> <div style="width: 1000px">
>     <div id=outer style="width: min-content">
>         <div id=inner style="width: 50%"><div style="display:inline-block;
> width: 100px"></div></div>
>     </div>
> </div>
>
> Should the inner div be width 50px or 500px? It's not clear to me which is
> better.

Neither, it should be 100px.

The #outer div is width:min-content, so it asks all of its children
for their min-content.
> The #inner div is sized as 50%, but it's relative to an indefinite width, so it's ignored and treated as 'auto'.
> Under a min sizing constraint, 'auto' becomes 'min-content', so #inner also asks its children for their min-content width.
>> The inline-block is 100px wide.
> The #inner div is thus 100px wide.
The #outer div is thus 100px wide.

Don't try to be too smart about percentages; that way lies madness
(like tables).  Percentages are meaningful iff their containing
block's size is a definite size.

~TJ
Received on Friday, 13 July 2012 22:23:06 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:56 GMT