Re: Should 'display: none' be handled by 'visibility'?

----- Original Message ----- 
From: "fantasai" <fantasai.lists@inkedblade.net>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: "Markus Jonsson" <carnaby@passagen.se>; <www-style@w3.org>
Sent: Friday, July 27, 2007 2:58 PM
Subject: Re: Should 'display: none' be handled by 'visibility'?


>
> Andrew Fedoniouk wrote:
>>
>>
>>> I'm not sure if this has been discussed before, but the display property 
>>> has a minor problem. Often, {display: none} is used with dynamic
>>> html, where an element could show or hide on demand. Hiding is easy, but 
>>> once you need to reshow the element, you need to know the
>>> appropriate display mode. There are many to choose from, and cannot 
>>> safely be derived from the element name.
>>> Since changing the display mode of an element is essentially different 
>>> from just hiding it, wouldn't it be better if this was handled by
>>> the visibility property? So {visibility: none} would work like {display: 
>>> none} and take the element out of the flow, as opposed to
>>> {visibility: hidden} which makes the element invisible while it remains 
>>> in the flow.
>
> Would you want it to behave like "display: none", or to actually collapse
> to zero-height (which is different)? In the latter case, it would still
> affect the horizontal size of boxes that shrink-wrap around it. This is
> better for dynamic effects since it restricts layout changes to the y
> dimension, and it is closer to what "visibility: collapse" does for table
> rows.
>
> ~fantasai

Hi, fantasai

I answered in other message to Boris.

p { visibility: collapse }

Such a paragraph in normal (static)  flow
shall participate in computation of min/max-intrinsic widths of its
container but its height shall collapse. margin collapsing rules
for such elements shall be as in case of display:none;

This would be near the ideal solution in my opinion.

Andrew Fedoniouk.
http://terrainformatica.com

Received on Friday, 27 July 2007 22:45:16 UTC