W3C home > Mailing lists > Public > www-style@w3.org > February 2008

Re: Collapsing elements

From: Brad Kemper <brkemper@comcast.net>
Date: Thu, 21 Feb 2008 07:47:59 -0800
Message-Id: <AA1CF1DE-0EB7-4797-A58C-8051BBE4C6E6@comcast.net>
Cc: www-style <www-style@w3.org>
To: Bert Bos <bert@w3.org>

On Feb 21, 2008, at 7:07 AM, Bert Bos wrote:

>> We need to be able to query 'something' directly from the LI.
>> That means a solution based uniquely on the display property
>> of the children is not enough. We need an attribute on the LI
>> or a unique CSS property setting the expanded/folded status
>> of the item.
>
> A pseudo-class represents a state. According to CSS, elements can be
> active, visited, link, first-child, disabled, target, invalid, etc.  
> I'm
> adding one more: initial.
>
> How do you currently query CSS states from Javascript? Can't you
> generalize (one of) the existing methods to include ':initial' as  
> well?
>
> And there is actually nothing special about the LI. In my example  
> the LI
> *doesn't* have an ':initial' state. There may be any number of  
> elements
> whose states influence the style of the LI, because of cascading or
> inheritance.

The word "initial" sounds like it is only something that exists at  
the beginning, and once someone starts collapsing or expanding it, it  
is no longer initial. Does "initial" represent an open branch of the  
tree or a closed one? It would depend on the style sheet, I guess,  
but that makes its meaning vague. I would prefer something that more  
definitively indicated its actual current state ("opened" or  
"closed"), the way "checked" does for checkboxes and radio buttons.  
But rather than invent a new state and pseudo-class, I would rather  
see "checked' repurposed for this type of list, and given a  
definition to mean open if checked and closed if unchecked.

The author could always simulate reverse behavior if they wanted to,  
I suppose, but the default style sheet could just make "checked" tree  
LI's opened, and "unchecked" LI's closed.
Received on Thursday, 21 February 2008 15:48:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:01 GMT