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

Re: [css3-flexbox] make 'visibility: collpase' items more stable for multi-line flex container

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 4 Jul 2012 17:40:34 -0700
Message-ID: <CAAWBYDBfBG-79_A-oMX=xUZ_TQ9Y17QLHzog32i4_m_VP8dDvA@mail.gmail.com>
To: "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>
Cc: WWW Style <www-style@w3.org>
On Wed, Jul 4, 2012 at 5:31 PM, Kang-Hao (Kenny) Lu
<kennyluck@csail.mit.edu> wrote:
> (12/07/05 7:51), Tab Atkins Jr. wrote:
>> On Wed, Jul 4, 2012 at 9:02 AM, Kang-Hao (Kenny) Lu
>> <kennyluck@csail.mit.edu> wrote:
>>>   # 9. Collapse ‘visibility:collapse’ items. If any flex items have
>>>   #   ‘visibility: collapse’, note the cross size of the line they're
>>>   #     in as the item's strut size, and restart layout from the
>>>   #     beginning.
>>>
>>> I am not sure why this need to go back to the beginning, why can't we
>>> just make collapsed + uncollapsed items fixed in any flex line. That is,
>>> just jump to right after
>>>
>>>   # 5. Resolve the flexible lengths of all the flex items to find their
>>>   #    used main size, and determine their hypothetical cross size from
>>>   #    this main size.
>>
>> Because then you can have either ragged or uneven lines.  In many
>> cases, I think it will be better to rerun line-breaking, which is why
>> I specified it that way.
>
> I think with the current specced behavior the condition for 'visibility:
> collapse' to be useful for a multi-line flex container is significantly
> complex to be worth written down. The condition, as far as I can tell is,
>
> either
>
>   * The collapsed item has a bigger cross-size than most of other items.
>
> or
>
>   * The collapsed item doesn't go into another line (it shouldn't bring
> the strut size of one line to another) and an item with the biggest
> cross-size in a flex line doesn't go into another line if there's an
> item to be collapsed in the same line.
>
> Am I right here?

Yes.


> Not rerunning line-breaking would have a easier condition for
> 'visibility: collapse' to be useful: the lines with items to be
> collapsed are positively flexible.
>
> I can't tell if this condition is often met though.

Using positive flexibility on a wrapping flex container isn't a very
useful thing to do anyway, unless you pair it with max-width, because
the last line's items will be an unpredictable size.

In general, multi-line flexboxes are of limited utility - definitely
worth including, but simple enough that they don't quite do what you
want in various corner cases.  I expect we'll add more functionality
to better control multi-line flexboxes in a future version, but I
don't want to mess with the feature much at this point in the current
level's lifecycle.

~TJ
Received on Thursday, 5 July 2012 00:41:22 GMT

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