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

----- Original Message ----- 
From: "Markus Jonsson" <carnaby@passagen.se>
To: <www-style@w3.org>
Sent: Friday, July 27, 2007 4:18 AM
Subject: Should 'display: none' be handled by 'visibility'?


>
> 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.
>

> Markus
>

I am also who think that 'display' attribute should be used for display 
model purposes only.

CSS2.1 already have visibility: collapse [1] value that supposedly shall 
collapse table elements.

I think that it makes sense to redefine rendering behavior of visibility: 
collapse
and give it exactly the same meaning as display:none. We can do it safely
as IE is just ignoring visibility: collapse, Gecko understands it but
does not collapse inter-cell spacing that makes the collapse not usable at 
all.
Opera and WebKit/Safari interprets it as just visibility: hidden even for 
<tr>s.
Thus, I doubt that anyone is using it for the purpose it was designed for so
we can redefine it safely. I belive that semantically phrase 'visibility: 
collapse'
is even more precise than 'display:none' to what UA does in this case.

Andrew Fedoniouk.
http://terrainformatica.com

[1] http://www.w3.org/TR/CSS21/visufx.html#propdef-visibility

Received on Friday, 27 July 2007 18:04:18 UTC