[uf-discuss] Re: Precise Expansion Patterns

Manu Sporny msporny at digitalbazaar.com
Sun Dec 16 21:46:12 PST 2007


Paul Wilkins wrote:
> On Dec 17, 2007 2:38 PM, Manu Sporny <msporny at digitalbazaar.com> wrote:
>> By constricting DURATION to have a restrictive format, HH:MM:SS, we are
>> being short-sighted and are not thinking about the other Microformats
>> that are still to come that will need to specify DURATION.
>>
>> "00:02:23" is being shortsighted. Let's learn from our past and not make
>> the same mistake again... let's not be short-sighted about this decision.
> 
> If we stay with "PT2M23S" then how are we going to deal with the title
> attribute issues.

We have some suitable candidates for replacement... all of them are not
ideal, so we are going to have to compromise. We know the following:

1. Using DURATION with ABBR was a compromise, so it's not like we're
   replacing something that is perfect.
2. Hidden data is considered harmful by the Microformats
   community. <span class="foo" title="blah"></span> == bad
3. Semantically abusing tags is considered bad by the community.

> I consider the following to be bad
>     <abbr class="duration" title="PT2M23S"></abbr>2:23

Agreed. This is hiding data.

> Next we have the classical abbr-include-pattern.
> 
> This has issues in that the title is not an acceptable abbreviation of
> 2:23. The title text must be sensible to the human viewer.
>     <abbr class="duration" title="PT2M23S">2:23</abbr>

Agreed. This is abusing the semantic meaning of ABBR.

> Then there's the SPAN element. This one too has issues with the title
> text, in that anybody seeing it isn't likely to understand its
> meaning.
>     <span class="duration" title="PT2M23S">2:23</span>
> It appears that when the title text is used on content, it must must
> remain as a human-understandable construct.

Agree with the first part, readers are probably not going to understand
PT2M23S. Disagree with the last statement, this is not in violation of
the HTML spec, IMHO:

--------------------------------------------------------------------
http://www.w3.org/TR/html401/struct/global.html#adef-title

title = text [CS]
    This attribute offers advisory information about the element for
    which it is set.
--------------------------------------------------------------------

However, I do agree that "PT2M23S" is stretching the rules a bit.

> The SPAN element however has classically been allowed to be empty, as
> a placeholder for the likes of css images.
> This situation can be leveraged to provide computer data, without
> interfering with the content itself.
> 
> I consider the following to be less bad than the others above.
>     <span class="duration" title="PT2M23S"></span>2:23

Agreed. I personally don't have a problem with hidden data like this,
especially when there are tools like Operator that can be used to check
your work. However, there are others in the community that will fight
you (and me) on this.

Just to go back to a previous e-mail in the day... I don't think I fully
understood what Benjamin was proposing with the following:

<span class="duration">
   <span class="minutes">2</span>:<span class="s">25</span>
</span>

After looking at it again and running it through a variety of tests,
it's looking like a fairly good solution to the issue... very verbose,
but it doesn't have any of the previously stated problems
(accessibility, usability, or tag abuse), and there are several more
benefits that it brings. For example, you can do this:

<span class="duration">
   <span title="2" class="minute">two</span>minutes and
   <span class="second">43</span> seconds
</span>

For an example of how this looks, check out #6 on the following page:

http://uf.digitalbazaar.com/unit-tests/sandbox/isodata.html

You can also do stuff like this, for fractional elements:

<span class="duration">
   <span title="0.002" class="second">2 milliseconds</span>
</span>

In fact, if we had the following Microformat:

duration
  year
  month
  day
  hour
  minute
  second

We could address not only duration, but also specify time (January 15th,
2008):

<span class="dtstart">
   <span class="month" title="1">January<span>
   <span class="day">15<span>th,
   <span class="year">2008</span>
</span>

This line of reasoning follows what we've been doing with hMeasure:

http://microformats.org/wiki/measure-brainstorming#Straw_man

Was this what you were getting at, Benjamin?

-- manu


More information about the microformats-discuss mailing list