[uf-discuss] Appeal for Issues: Empty spans in value-excerption-pattern

Ben Ward lists at ben-ward.co.uk
Fri Nov 7 13:04:31 PST 2008

Hi André,

On 7 Nov 2008, at 08:38, André Luís wrote:

> I can see this option being adopted by people who are concerned about
> accessibility, while others might just go ahead and use the
> regular-problem-maker-of-a-pattern the datetime design pattern,
> preferring simplicity over accessibility. Right?

Well, first up, all web developers are supposed to be concerned about  
accessibility, otherwise they're not doing their job properly. I'll  
avoid digressing into that, though!

All optimisation patterns in microformats are valid for some purposes.  
Using an ABBR for country names is completely the Right Thing To Do,  
whilst for a timestamp it may not be. As with many methods in HTML, a  
degree of author interpretation of semantics will always take place,  
and authors will implement what makes sense to them.

There has to be an acceptance that valid HTML4 does not allow for  
embedding alternate-form content, so we're trying to build something  
that fits as logically and gracefully as we can. For me, the ‘machine- 
data’ value being a child of the property (a sibling of the display  
form) makes total structural sense.

An advantage of this pattern is that it is based entirely around  
neutral mark-up (span), although there is also no need to restrict it  
to any one element (you can use <b class="value"> if you like, or  
<input type="hidden" class="value"> if you want; we and our parsers  
shouldn't and don't care).

Using the @title attribute of this value element when the user does  
not want the value to be displayed is a little cludgy, but justified  
by the fact that it is not rendered in any browser (although that  
behaviour is a specification grey-area). Despite a stretch over the  
traditional use of title, @title is still associated with the  
class=value element. I think they have a valid and appropriate  
relationship; I read it as ‘the title of the value is 2008-11-07’.  
It's not as strong a relationship as the inner-text, but it's not  
nonsense, either.

There is also a viewpoint that @title should only be for human  
consumable data. I agree and subscribe to this viewpoint. But in this  
mark-up pattern, the @title of an empty element is never exposed to  
ANY human in any way — that has been tested by the lovely James Craig  
of Apple, who has confirmed that empty <span>s do not get exposed to  
screen readers (although empty <abbr> elements can). Thus, I think the  
benefits and grace of the structure justify that exception. This is  
also the line of exception I would make when writing coding standards.


More information about the microformats-discuss mailing list