Stay in touch!

Making a case for the dialog element in HTML 5

I’d spent a lot of time writing a post about the glorious new tags introduced in HTML 5, but unfortunately, just as I was about to put it up, I caught wind that the spec for the <dialog> tag has been nixed. Considering that a hefty portion of my article was devoted to illustrating how the new tag could be put to use to display dynamically generated web comics of instant message conversations, I was understandably put out.

The dialog element was just a glorified definition list.

Originally, this was the suggestion for how to use <dialog>:
<dialog>
<dt>Brenda</dt>
<dd>I love Coco Wheats!</dd>
<dt>Jason</dt>
<dd>I prefer Malt-O-Meal.</dd>
</dialog>
Look familiar?
<dl>
<dt>Coco Wheats</dt>
<dd>A cream hot cereal with a cocoa treat.</dd>
<dt>Malt-O-Meal</dt>
<dd>Like Coco Wheats only with malt instead of coca powder.</dd>
</dl>
Yes, <dialog> is unabashedly based on the definition list. It doesn’t even try to hide the “data term” and “data definition” tags as it appropriates them. Admittedly, most people either don’t use or don’t know how to use definition lists because the official definition list specification is rather sketchy. But that’s no reason to hijack its structure! Personally, I do not think the definiton list structure is perfectly suitable for dialog markup because:

It allows multiple definitions for one term (or quotes for one speaker... I feel it would be better to lump these into one element and use paragraph elements to break up longer monologues).

There is no way to indicate time.

There is no way to make comments, as in an interview when the author inserts an explanatory note or in a play when the scene changes)

Most discussions on this matter only use chat logs as examples of what dialog markup could be used for. Yes, chat logs seem rather trivial in the grand scheme of things. But what about plays? Interviews? Dynamically generated comics books? (Not to push my own cause!) Okay, excluding that last one, the other two are potentially big deals. Imagine if screen readers adopted a different tone when reading transcripts to the visually impaired. Imagine if we could use this to convey great plays of yore to little kids one day. None of this would happen tomorrow of course, but it can’t happen at all without proper markup.