W3C home > Mailing lists > Public > public-html@w3.org > June 2007

Re: html 5 and accessibility issue

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sun, 01 Jul 2007 03:38:06 +1000
Message-ID: <468694FE.9030301@lachy.id.au>
To: aurélien levy <aurelien.levy@free.fr>
CC: public-html@w3.org

aurélien levy wrote:
>>> because actually i can do :
>>> <dl>
>>>  <dt> 1st terme </dt>
>>>  <dd> 1st terme description </dd>
>>>  <dd> 2nd terme description </dd>
>>>  <dt> 2nd terme </dt>
>>>  <dt> 3rd terme</dt>
>>>  <dd> 3rd terme description</dd>
>>> </dl>
>>> with no way for AT to know that 2nd terme description is actually 
>>> the 2nd terme description and not the second description of the 
>>> first terme
> the html 5 spec say :
> dt can be before |dd| or |dt| elements inside  |dl| elements.
> dd can be after |dt| or |dd| elements inside |dl|  elements.
> that's the case in my example

I think you're misunderstanding the spec.  That's simply describing the 
order in which elements may appear within the dl.

The content model for <dl> states:

| Zero or more groups each consisting of one or more dt elements
| followed by one or mode dd elements.

So the groups are created by implicitly grouping all consecutive <dt> 
elements followed by all consecutive <dd> elements.  Regardless of what 
you wanted to achieve in your example, the "2nd terme description" is 
defined to be the second dd of the first group.

>> It's also not clear what the use case for doing so is.  Just swap 
>> the <dt> and <dd> for the 2nd term and description, and it gives 
>> the intended meaning.
> Because i can want to have my description visually before his term (i 
> know i can achieve that with css but most of people simply choose the 
> simplest way).
> Even a full dd dt structure in this order validate in html 4
> http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.fairytells.net%2Fdltest2.html

In HTML4, although it would validate, it would never really have the 
meaning you want.  The first <dd> would have no associated term, and the 
last <dt> would have no associated description.  HTML5 fixes this bug in 
HTML4 that allowed descriptions without terms because it makes no sense.

Ideally, the correct way to achieve the layout you want would be with a 
stylesheet, or possibly XBL.

Personally, I'm not convinced of use case.  I just can't imagine why one 
would want to order them like that using any method.  But if that is a 
real use case, and is something you have done before, it would help if 
you could provide real world examples to demonstrate how and explain why 
it has been used.  You can then document it in the wiki, and record the 
various possible solutions with their pros and cons.

Robert Burns wrote:
> Its possible we could add more structure to a definition list like
> XHTML2 did with:
> <dl>
>     <li>
>         <dt></dt>
>         <dd></dd>
>     </li>
> </dl> 
> This might help make a stronger association and even allow reversing
> the normal HTML 4.01 order  for these elements.
> If there's a use case for such more complicated definition lists we
> would need to come up with though (if necessary).

That structure has been considered before, but, IIRC, so far rejected 
due to lack of convincing use cases.

(if you're going to document this in the wiki, I recommend searching the 
WHATWG archives for related discussion and include <di> as a possible 
alternative to <li>)

Lachlan Hunt
Received on Saturday, 30 June 2007 17:38:23 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:22 UTC