[uf-discuss] Re: Using <object> for datetimes (was: Microformats and RDFa not as far apart as previously thought)

Ben Ward lists at ben-ward.co.uk
Sat Jun 28 10:09:48 PDT 2008

On 28 Jun 2008, at 17:03, Ed Lucas wrote:

> George Brocklehurst wrote:
>> Is it worth revisiting Tantek's original suggestion of using the  
>> object element to represent dates? [1]
>> The idea was to do something like this:
>>    <object data="20050125">January 25</object>

This particular example is invalid, as the data="" attribute must  
contain a URI, and a URI cannot start with a number.

>> display:inline and intrinsic sizing will work correctly.  Safari  
>> 2.0.2, which came out in November 2005, was the first version to  
>> contain these improvements [2].

For note, I don't feel that CSS support on an element should be of  
consideration when designing microformats. We are operating at the  
HTML level and must not produce techniques which depend on them  
(although documenting techniques where CSS can be used to enhace/alter  
microformats is still valuable, I'm simply meaning that HTML+CSS must  
not ever be the primary solution to a problem).

>> It might be that there are other reasons for not using <object>  
>> that I've missed (I'm fairly new to the wonderful world of  
>> Microformats) and it might be that there's still a significant  
>> population of Safari users on 2.0.1 or older, but if not this could  
>> be a way forward that gets around the <abbr> issue.
> I'm normally just a lurker here, but no-one has replied, so...

> Using the object element seems like a very sensible solution. What  
> are the blocking issues now that Safari handles it?

So, one solution I saw offered to the URIs-can't-start-with-numbers  
issues was to do everything as a URL fragment, converting it to:

<object data="#20050125">January 25</object>

That, however, causes Safari 3 to render a box of the current page  
within the OBJECT element, and so would introduce a CSS dependency to  
keep it hidden. No good, I fear.

*However*, the following appears to be well behaved inline in Safari  
2.04 and 3.1.1, Firefox 1, 1.5, 2 and 3, and Opera 7, 8 and 9.

<object class="dtstart" data="data://20080712"></object>

That uses the DATA URI scheme, which without a specified mime type and  
charset, defaults to text/plain;chartset=US=ASCII. I think that would  
be sufficient.

I've pastied my test case, and would be grateful if people could test  
the behaviour in Internet Explorer: http://pastie.org/224023

Given that IE has a history of abysmal support for OBJECT and no  
support for data: URIs… I have no idea what might happen.

See also:

     http://tools.ietf.org/html/rfc2397 (data: spec)
     http://www.ietf.org/rfc/rfc2396.txt (URI spec)


More information about the microformats-discuss mailing list