W3C home > Mailing lists > Public > public-html@w3.org > September 2009

Re: what is dt?

From: Smylers <Smylers@stripey.com>
Date: Thu, 17 Sep 2009 17:18:07 +0100
To: Shelley Powers <shelleyp@burningbird.net>
Cc: public-html@w3.org
Message-ID: <20090917161807.GX4359@stripey.com>
Shelley Powers writes:

> Smylers wrote:
>
> > ... note that <dt> isn't necessarily a definition list -- it can be
> > used for a list of any name-value pairs.
>
> For the past ten years or so, dl, dt, and dd have been defined within
> the context of a definition list. People may have used them for other
> things, but no where has there been even a hint that such use was
> "acceptable" or appropriate.

Right, but the point of a new version of something is to make changes!
In practice what <dl> does is associate the <dd> with the <dt>.  The
<dd> being the definition of <dt> is one example of that, but is there
actually any harm in expanding <dl> to be more generic in this way?
Definition lists are still explicitly permitted.

Do you have a better alternative for marking up a list of name-value
pairs, such as metadata for a document (author, date, version, licence,
say)?

> Except now, when seemingly dt and dd have become HTML5 silly putty:
> good for a hundred and one uses.

Humans are surprisingly good at being context-sensitive.  Many words or
symbols have different meanings in different places (such as "-"
variously doing duty for hyphen, negation, subtraction, and en dashes).
Mostly they do this naturally without thinking about it, or even
noticing it.

So it's actually <dl>, <details>, and <figure> which have different
uses.  <dt> and <dd> are 'building blocks' which each of those happen to
contain.

And they hardly have completely different uses: in all cases the <dt> is
being used to label the <dd>, so they're comparable (in a way which,
say, using the same element for each of <meta>, <li>, and <tbody> would
not be).

<dt> is an awful name for an element which means 'figure caption'.
Indeed it's hard to think of anything which could be a worse name.  But
it isn't entirely inconsistent with other uses of <dt>.

> > > And now, seemingly, its a part of the so-called "details" element,
> > > whose purpose is, well, I'm trying to figure that one out,
> >
> > It's a way of making additional details about something available to
> > users without them necessarily being exposed all the time.  For
> > example on your Twitter homepage the sidebar has 'Trending Topics'
> > and 'Following', whose contents can be expanded or collapsed.
> 
> We have managed in the last decade or so to handle this type of
> behavior using CSS and/or JavaScript.

Yes.  That so many authors create it themselves demonstrates its
popularity on the web.

Having the browser provide this functionality is a benefit for authors,
since it reduces the work they have to do.  In particular, beginners
don't have to learn JavaScript in order to achieve it.

It's also a benefit for users, since the meaning (that some additional
information is not deemed important enough to present by default is
available on request) is available even to those without JavaScript.
And because the meaning, rather than the mechanism (a drop-down box), is
what's conveyed in the HTML, user-agents are free to present this in
different ways, depending on what's best for that user's environment and
any disabilities.  A speaking browser can make a sensible choice based
on the semantics of 'label plus additional information', which it can't
when only given a lump of JavaScript.

> If this behavior, not markup, not page element, behavior, is now
> deserving of its own element, why stop there?  Where is dropdown menu?
> Where is tab?


I believe menus are in HTML5 (that they drop-down is a presentation
detail), and tabs are merely one particular representation of navigation
lists, again which are included.  It's important to disentangle the
underlying meaning which needs to be conveyed from specific
presentations.

> Where is accordion?

Possibly I've misunderstood what an accordian is, but doesn't <details>
cover this case?

> Where is alternative table row?

I'm sorry, that isn't a term I'm familiar with.

> What boggles me the most, is that the same time this change was made,
> dialog was eliminated. Yet dialog is the one that people have been
> trying to mark up effectively for the last ten years.

Actually dialogue isn't that common on the web -- few pages contain any.

The HTML4 spec told them to use <dl> for dialogue, yet most people
ignored this.  It turns out that in practice they'd rather use lists or
paragraphs to mark up conversations.  That seems adequate.

> > Again, the <dt> is labelling the content
>
> Suggestion: use any search engine, check for dt, dd, and dl. In the
> first several pages of returned results, find me one instance where
> people aren't talking about these elements in the context of a
> definition list.

Of course people discussing HTML4 will call <dl> a definition list.
That isn't the same thing as people merely using <dl> (but not those so
into HTML to discuss it) have restricted themselves to a narrow
definition of definitions, rather than other name-value pairs.

And of course existing discussions of <dt> and <dd> are related to <dl>.
People are hardly likely to be discussing uses for those elements which
had yet to be invented!  In no way is that a demonstration that there's
actually a problem with re-using them.

> Look at Figure now. The thing is so painful to look at, it's like
> fingernails across a chalkboard.
>
> We have a Figure element, we might expect to see caption, but we see dt
> instead, causing a mental jerk, because dt has been used for the past
> ten years for something else, and then we're throwing the figure content
> into a dd element.
>
> Ugh, ugly, ugly.

I agree it's ugly.

> This was such a bad decision. No thought either, just throw something
> out because some "super friends" had a hissy about legend. I agree by
> the way, about the use of legend, but their suggestion was for
> "label".

That's unfair on Ian, who originally specced <legend> and defended it
hard on the grounds that anything else viable would be ugly.  There is
plenty of evidence documenting that he is well aware of the ugliness.

But being aware of it doesn't magically make it go away, when there are
other competing concerns (people want <details> and <figure> now) and
contraints (most of the good names are already taken, and can't be used
now, if at all).

Smylers
Received on Thursday, 17 September 2009 16:18:37 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:08 UTC