W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2007

[whatwg] [html5] Use cases for DI element

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 6 Nov 2007 18:36:21 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0711061642400.30809@hixie.dreamhostps.com>
On Tue, 26 Apr 2005, Anne van Kesteren wrote:
>
> As use cases were requested for the DI element:
> 
>  1. Identifying a definition group.
>  2. Editing a definition group
> 
> When you have a list of items:
> 
>  <dl>
>   <dt>foo
>   <dt>bar
>   <dt>baz
>   <dd>terms
>   <dd>programmar's slang
>   <dt>HTML
>   <dt>CSS
>   <dd>Internet languages
>  </dl>
> 
> ... there is no simple way to identify a definition group.

You'd still have to identify them in the "complicated" manner to take 
<di>-lacking content and wrap <di>s around them.


> One way would be to give the first DT element an ID attribute but than 
> the definition for ID would have to be changed. Also, when later through 
> contentEditable a new DT element is inserted above the DT element with 
> an ID attribute the ID attribute would have to be moved.
>
> (It is useful to have an ID attribute for FAQs, et cetera where you want 
> to link to the answers.)

Sure, but then the same applies to linking to a paragraph and placing 
another related paragraph before it, or linking to a subsection and adding 
a subsection before it.


> It also makes editing of a definition group easier. Say users may edit a 
> single group, you do:
> 
>  <dl contentEditable="false">
>   <dt>foo
>   <dt>bar
>   <dd>terms
>   <dt contentEditable="true">HTML
>   <dt contentEditable="true">CSS
>   <dd contentEditable="true">Internet languages
>  </dl>
> 
> ... however, now you can't insert new definitions like "XML" or new 
> descriptions. Using the opposite does enable that (setting 
> contentEditable to true for the DL element and setting it to false for 
> all elements that shouldn't be editable) but it creates another problem 
> namely that people can insert new definitions.

I agree, but we already have this problem again in general for this, e.g. 
you want to be able to add elements to <ol> but only edit a particular 
part of am <li> or something like that.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 6 November 2007 10:36:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:47:42 GMT