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: Alex Mogilevsky <alexmog@microsoft.com>
Date: Wed, 23 Feb 2011 20:40:32 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928411EA021C@TK5EX14MBXC212.redmond.corp.microsoft.com>
I disagree that the resolution doesn't define what to do if the first child is empty. What it doesn't define is how to determine the baseline of the child when it is a regular block with regular text flow. I am assuming that it should determine its baseline *as if it was an inline block*. The spec should include that or any other rule for block children.

If above is true, behavior with one empty child is also consistent "bottom of content box" for empty flexbox.

I agree there is inconsistency with inline-block. But I think inline-block behavior is driven by cases where inline-block is an inline image or object, potentially with padding border, and aligning image at a line inside its border would be odd... Flexbox however is always a container, so consistency across different types of children seems more important.

The case could be made however that if a horizontal flexbox only contains replaced elements it could have baseline at border box or margin box. We can discuss that. I don't particularly like the idea though as it makes definition more complex and I don't see a clear use case for the change.

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Wednesday, February 23, 2011 12:25 PM

>   - 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 sure where exactly in content box is the best place for baseline... I think bottom of content box would be a good choice.

That seems reasonable, though I'm not overly happy with the difference from inline-block.
Received on Wednesday, 23 February 2011 20:41:07 GMT

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