[uf-dev] Using class for non-human data

Frances Berriman fberriman at gmail.com
Fri Jun 20 03:40:40 PDT 2008


Hey all,

Firstly, with my BBC hat on, I wanted to point out that our Standards
and Guidelines group have recently added a few additional clauses to
our semantic markup standards.  They are as follows (I don't think the
most recent document is available yet, but I'll certainly link through
to it when it's available):

--
5.1. Title attributes MUST contain human-readable data.
--
8.1. You MAY use microformats on your site where there are agreed
specifications (refer to the Microformats community wiki site for
details) with the exception of those that use the title attribute of
HTML's abbr element.
8.1.1. Some microformats use the abbr element to conceal
machine-readable data; for example, date-times and geographical
coordinates. For screen-reader users that expand abbreviations they
will hear the full date-time or coordinate; for example
2008-05-15T19:30:00+01:00 instead of 19:30.
8.1.2. If you want to use microformats in the abbr element you MUST
first discuss this with the Editor, Standards and Guidelines.
8.2. If you do use microformats, you MUST ensure that the title
attribute contains human-readable data. See also Title attributes
above.
--

Consequently, we've been looking at the machine-data proposals in the
hope that we'll be able to keep using things like hCalendar.  After
having a chat with Ben about that document, we (myself and colleagues)
have these additional concerns with the proposed solution:
* The empty tag causes potential problems in CMS implementations (i.e.
some of our tools, for example, will publish <span title="foo" />
instead of the desired empty element).
* Using two elements for one job.
* The data is not discretely associated with what it *should* be surrounding.
* Future proof?  What if screen readers did start to implement always
expanding title attributes, even on empty elements?

Additionally, we felt a concern about using empty elements could
encourage bad practices and also with our new (but not necessarily
irreversible) guidelines about the contents of title attributes, we're
a little stuck.

Being that our main concerns centre around the questionable use of
"title", we've been looking at the idea of using "class" instead.
Something along the lines of:

<span class="dtstart data-20051010T10:10:10-0100">10 o'clock on the 10th</span>

The pros to this would be that it's non-harmful and the HTML spec does
suggest that user-agent data may be stored in class.  On the downside,
the semantics again could be questionable (but arguably less so than
the semantics of title).

What I'm interested in talking about is what other problems arise from
using "class". Can it be used, should it be used and what problems
could there be from the parsers point of view?  Have we missed
something fundamental about why we don't already use the class
attribute more often?

I'll create a wiki page for this shortly (any preference where you'd
like this to live, anyone?).  Just wanted to get this out there.

Cheers :)
F



-- 
Frances Berriman
http://fberriman.com


More information about the microformats-dev mailing list