[whatwg] [WA1] <sl> - The Selection List element

On Thu, 2 Jun 2005, Matthew Raymond wrote:
>
>    I'm proposing a new element named <sl>. This element is a list where 
> the list items become selected when the items or their child elements 
> are activated (i.e. someone clicks on them). Here's an example:
> 
> | <sl>
> |   <li><a href="#s1">Section 1</a></li>
> |   <li><a href="#s2">Section 2</a></li>
> |   <li><a href="#s3">Section 3</a></li>
> | </sl>
> 
>    In the example above, you have a list of links where the containing 
> list item is selected when someone clicks on the link. The presentation 
> of the selected items is handled through CSS:
> 
> | li:selected { /* Your style here. */ }
> 
>    By default, the selection would be mutually exclusive. In other 
> words, the default for clicking on a list item is that it would become 
> the ONLY selected item, similar to <select>. Also similar to the 
> <select> element, you could specify a |multiple| attribute to select 
> more than one item:
> 
> | <sl multiple="multiple">
> |   <li>Name 1</li>
> |   <li>Name 2</li>
> |   <li>Name 3</li>
> | </sl>
> 
>    If multiple items are selected, and the user performs a drag 
> operation on a list item, the drag would automatically be performed on 
> all list items selected rather than just the list item being dragged.
> 
>    If you want to use this element to create a tabbed control, it would 
> look like this:
> 
> HTML:
> | <sl>
> |   <li selected="selected"><a href="#s1">Section 1</a></li>
> |   <li><a href="#s2">Section 2</a></li>
> |   <li><a href="#s3">Section 3</a></li>
> | </sl>
> |
> | <switch>
> |   <section active="active" id="s1">[...]</section>
> |   <section id="s2">[...]</section>
> |   <section id="s3">[...]</section>
> | </switch>
> 
> CSS:
> | sl > li { appearance: tab; display: tab }
> | sl > li:selected { display: front-tab }
> 
>    The idea is that a hyperlink to a <section> within a <switch> will 
> automatically set that <section> as active. Yes, I know that this makes 
> <tabbox> pointless, but I don't see <tabbox> as having any serious 
> advantages, especially when you have <switch>. With a very small amount 
> of Javascript and CSS, you can make an unordered list and a <switch> 
> behave in exactly the same manner as <tabbox>, so what do we need 
> <tabbox> for?

This is an interesting idea, but I'm not really sure the use cases are 
convincing. However, we now have <datagrid> and other new features which 
may address those cases anyway, so you might be happy with the spec anyway 
at this point. Does 


On Fri, 3 Jun 2005, Aankhen wrote:
> 
> Could the `scope` and `axis` attributes help here?

I think they're having enough trouble dealing with tables without us 
making their life more complicated here. :-)


(There were other comments on this thread but they mostly seemed to be 
discussion amongst the participants and I didn't see anything there that 
really affected the spec. Sorry if I missed something. Feel free to bring 
stuff up again!)


On Mon, 6 Jun 2005, James Graham wrote:
>
> I totally agree. I'm not really suggesting attching semantics to 
> particular class names (although others are, in other places - the needs 
> some simple form of namespacing imho). I'm more suggesting that we have 
> a mechanism to attach predefined behaviors (such as selection) based on 
> class name. So I guess we could have an element like <selectgroup 
> classname="myclass" multiple="False" /> or somesuch to attach a behavior 
> to all the elements in class "myclass".

I think XBL2 is probably a better way of doing this.


On Wed, 8 Jun 2005, Matthew Raymond wrote:
> 
> Well, you use the |class| attribute for styling purposes. Therefore, 
> assuming selection is semantic (and I feel it is, since it's already 
> used by <select> and such), then the <selectgroup> element is 
> effectively styling members of a class with new semantics they otherwise 
> wouldn't have.

It's not clear to me exactly which kind of selection we're talking about 
here, though.


On Wed, 8 Jun 2005, Matthew Raymond wrote:
> 
>    Er...but I have no intention of making selection only accessible via 
> script. My system defines the selection type ("single", "multiple", et 
> cetera) and what can be selected in markup, then allows the user to 
> change the selection directly without the use of Javascript.

But what can they do with it?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 6 November 2007 13:38:34 UTC