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

I am probably a bit late in this discussion... nevertheless...

AFAIR flexbox (at least in XUL) includes two distinct layout managers:
vertical and horizontal.

Each LM has its own interpretation of baseline. Horizontal row of elements 
has perfect
meaning for baseline. Consider this (select with dropdown popup list):

Here is: <select><caption>item1</caption><button /></select>

In my case that select is styled as

select { flow:horizontal; display:inline-block; }
select > caption { width:*; padding:...; margin:...; }
select > button { width:XXpx; height:*; }

Its baseline is derived from first child that has text in it (<caption> 
And flow:vertical LM traditionally uses last child with text for
that. As do flow:horizontal-wrap, it uses last row baseline.

Technically it is possible to use vertical-align:baseline with
children of flow:horizontal containers. And that baseline can
be used as a baseline of flow:horizontal container itself.

Did I miss anything in principle?
Andrew Fedoniouk

-----Original Message----- 
From: Boris Zbarsky
Sent: Friday, February 18, 2011 6:04 PM
To: Tab Atkins Jr.
Cc: www-style list ; Alex Mogilevsky
Subject: Re: [css3-flexbox] Flexbox needs to define where the baseline of a 
box is

On 2/18/11 8:08 PM, Tab Atkins Jr. wrote:
> Hmm, I don't see that.  Assuming code like<div
> style="display:flexbox;">   </div>  (two spaces), rule 1 doesn't apply
> (no linefeeds), rule 2 doesn't apply (wrong white-space), rule 3
> doesn't apply (no linefeeds), rule 4.1 doesn't apply (everything's a
> space), and rule 4.2 removes the second space only.

Yes, agreed so far.

> In the second group of rules, rule 1 would remove the space, but that
> doesn't happen until lines are laid out, which logically can't occur
> until the box tree has been constructed.

Rule 1 of that second set of rules is applied before the box tree is
constructed in both Gecko and Webkit in many cases, and for purposes of
baseline calculations I'm pretty sure Gecko pretends like it's applied
then in all cases...  I can't speak to other implementations.  But in
any case, see below.

> So an anonymous block has
> already been wrapped around the remaining space, and it's the block's
> job to report its own baseline, not the flexbox's.  This is presumably
> already defined.

Nope.  The baseline of a block is not defined anywhere, because blocks
don't have to participate in vertical alignment normally.  The cases
that have blocks inside them and may need to participate in vertical
alignment in CSS 2.1 are table cells and inline-blocks, which both
explicitly define the position of the baseline inside them.


Received on Saturday, 19 February 2011 05:17:22 UTC