[whatwg] [html5] Use cases for DI element

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

Using a DI element that is easily solved as the DI element with an ID 
attribute would identify the definition group.

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.

Again, a DI element would solve the issue.


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Tuesday, 26 April 2005 04:24:54 UTC