Seeking a long-term solution for the problems outlined in Web Standards Project: hAccessibility. Namely, human-unfriendly text being placed in title attributes due to there being no attribute for arbitrary data in HTML4.
Background
The Microformats community are producing ways to interlace web content with small amounts of machine-readable information. But there are problems:
- HTML4 has many attributes for machine-readable information (such as href and cite) but most elements are not allowed them.
- A suitable attribute does not exist for some types of data (e.g. digital timestamps and geographic locations).
title in HTML4
However, the title attribute is explicitly defined as being for human-readable information in HTML4:
The "text" link points to this:W3C wrote:title = text [CS]
This attribute offers advisory information about the element for which it is set.
(Source: HTML4: 7.4.3 The title attribute.)
So it seems arbitrary data is not currently permitted in title attributes. Given the problems it can pose to users (as outlined by the Web Standards Project) this seems like a useful constraint.W3C wrote:6.3 Text strings
A number of attributes ( %Text; in the DTD) take text that is meant to be "human readable".
(Source: HTML4: 6.3 Text Strings.)
Meta Data in HTML4
HTML4 does define a mechanism for supplying arbitrary data. The <meta> element:
However, this cannot be interlaced with content and that is the purpose of Microformats.W3C wrote:
- Code: Select all
<!ELEMENT META - O EMPTY -- generic metainformation -->
<!ATTLIST META
%i18n; -- lang, dir, for use with content --
http-equiv NAME #IMPLIED -- HTTP response header name --
name NAME #IMPLIED -- metainformation name --
content CDATA #REQUIRED -- associated information --
scheme CDATA #IMPLIED -- select form of content --
>
(Source: HTML4: The META element.)
Proposed Solution
I propose creating an attribute for arbitrary data:
- Values for this attribute MAY be convenient for humans to read but this is NOT REQUIRED.
- It MAY be presented to users but this is NOT REQUIRED (like how href is presented in GUI status bars whilst cite is not).
- The attribute could logically be called content as its purpose is similar to <meta content> in HTML4. Other names might be better.
- The attribute would be allowed on lots of elements, perhaps any element permitted in <body>?
Allowing the scheme attribute to the same elements may be useful. Its purpose would be to carry the Microformat class value to prevent class-based selection (e.g. via CSS or DOM) in cases where this may be undesirable. This purpose is similar to <meta scheme> in HTML4.
Solution Examples
Digital Timestamps
- Code: Select all
The party is at
<abbr class="dtstart" title="20051010T10:10:10-0100">10 o'clock on the 10th</abbr>.
- Code: Select all
The party is at
<time class="dtstart" datetime="20051010T10:10:10-0100">10 o'clock on the 10th</time>.
- Code: Select all
The party is at
<time scheme="dtstart" datetime="20051010T10:10:10-0100">10 o'clock on the 10th</time>.
Digital Geographic Locations
- Code: Select all
<abbr class="geo" title="30.300474;-97.747247">Austin, Texas</abbr>
- Code: Select all
<span class="geo" content="30.300474;-97.747247">Austin, Texas</span>
- Code: Select all
<span schema="geo" content="30.300474;-97.747247">Austin, Texas</span>