[whatwg] [html5] Use cases for DI element

Ian Hickson ian at hixie.ch
Tue Nov 6 10:36:21 PST 2007


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.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list