[html5] List types

Ricardo Tomasi ricardobeat at gmail.com
Mon Oct 25 07:28:23 PDT 2010


Jukka K. Korpela wrote:

>* Before the HTML5 the dl tag was a "definition list"*
> In practice, the dl element has been used for a wide range of purposes,
> defeating the original idea.

> If someone has used dl for such a purpose, why should we
> tell him it's wrong?)

AFAIK Googlebot and others already look into definition lists for
"definitions" (as in define:something search queries). Sometimes you
can spot misused dl tags in there, when you get some random/specific
data as definition text.

>* But other discussion is "ol" or "ul" for forms. What's more correct?*
> Since the early days, ol has been a numbered list and ul has been a bulleted
> list. The difference is in rendering and could be expressed in CSS.

The ol and ul tags have had their semantic meaning (ordered list,
unordered list) since at least 1999, that's more than a decade. You
can turn divs into a bulleted list using CSS.

> (...) It's pretty harmless
> that authors select <ul> or <ol> according to the desired default rendering.

I don't see selecting elements according to a desired default
rendering as recommended practice by any of the standards bodies.

> It's pretty nonsensical. Putting form fields into a numbered list doesn't
> help anyone. A sequence of form fields with associated labels constitutes a
> two-column table more than anything else. (There's little point in making it
> a dl element, since the default rendering would be rather unsuitable.)

Again, rendering is out of scope for this matter.

Tables are for tabular data. In addition, a label already defines it
relationship to an input by itself (the for attribute), so by putting
form controls in a table you're making a redundant association between
those elements. What would be a suitable header for the labels column?
"Labels"?

Putting form controls in a list helps screen-reader users, by letting
them know the total number of inputs/steps in the form, and allowing
them to navigate easily. It also makes sense to consider label/input
pairs as separate pieces. As a bonus, it makes for easy styling.

> (...) The author may have chosen to use ol e.g. just because the
> items will then be automatically numbered, so that they can more easily be
> referred to, or maybe just to indicate the number of items in a natural way.

An author may have chosen to use a fieldset+legend for his header
titles because it has a fancy border, but I fail to see how this is
relevant for the matter of semantics, or accessibility. Should we just
ignore the specification and do whatever we wish? Again, the semantics
for ul and ol elements has been established for more than a decade.

--

ricardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20101025/f440c236/attachment-0002.htm>


More information about the Help mailing list