Re: [css3-flexbox] visibility:collapse on flexbox items

On 10/03/2011 02:36 PM, Ojan Vafai wrote:
> Now that I understand the behavior of visibility:collapse in tables, I don't think we should extend the behavior elsewhere. We
> should just have visibility:collapse work the same way on flexboxes as it does elsewhere (i.e. like visibility:hidden).
> Otherwise, visibility:collapse becomes this complicated beast that noone can use because the rules are different for each
> display type.
>
> I agree with Alex that we need a way to show/hide items without wiping
> their display property, but we already have that with the "hidden"
> attribute (see http://www.whatwg.org/specs/web-apps/current-work/#hidden-elements).

I think you missed Andrew's point. Nevermind the syntax, the *behavior* of "display: none"
is not actually what you'd want for dynamic show/hide behavior. Because it takes the element
entirely out of flow, the hidden element no longer influences layout at all. Which means
that by showing/hiding the element, you are adding/removing its influence on the parent's
intrinsic sizes, and potentially thus also its size--this is not always what you want.

Another side effect is adding/removing its influence on list counters, etc.

We don't actually have the right capabilities in CSS to do good dynamic showing/hiding
of elements. Visibility: collapse was supposed to do this, but it only works for tables
and then only when there are no rowspans/colspans involved.

See also the discussion at this thread:
   http://lists.w3.org/Archives/Public/www-style/2008Feb/0130.html

~fantasai

Received on Monday, 3 October 2011 23:59:02 UTC