W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: [css3-flexbox] Flexbox needs to define where the baseline of a box is

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 23 Feb 2011 12:24:49 -0800
Message-ID: <AANLkTiki2neefyLjHWdCE9tB5Q4MQygo17k3MTRTfaF3@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
On Wed, Feb 23, 2011 at 12:58 AM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
> I am not sure it was quoted in this thread yet, but here is what was decided in Oslo [1]:
>   - RESOLVED: Baseline of a flexbox is the baseline of its first
>     child. Note: this may be revisited based on use cases. ISSUE-141
>       http://www.w3.org/Style/CSS/Tracker/issues/141
> It handles most cases of interest, but not the case when the flexbox is completely empty. Then the baseline can only be based on the box.

It also doesn't handle this case:

<div style="display: flexbox"><div></div></div>

That is, the case where the first child is an empty block with no
inline content to grab a baseline from.

> I am not convinced though that "after outer edge" (border box, right?)

"outer edge" is the margin edge, but border edge would be fine too.  I
just want to be consistent with inline-block if we go this route.

> as Tab suggested is the best option. I think the baseline should be somewhere in bounds of content box. Then at least some cases retain continuity:
>        * adding a zero-height child to flexbox with auto height does not change the baseline
>        * baseline of an empty flexbox with "height:1em" is exactly where it would have been if it had a child with one line of text in font with no descent (and no MBP)
>        * flexbox padding and border don't affect its baseline, whether it is empty or not.
> I am not sure where exactly in content box is the best place for baseline... I think bottom of content box would be a good choice.
> [1] http://lists.w3.org/Archives/Public/www-style/2010Sep/0002.html

That seems reasonable, though I'm not overly happy with the difference
from inline-block.

Received on Wednesday, 23 February 2011 20:26:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:56 UTC