W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2009

[whatwg] A tag for measurements / quantity?

From: Max Romantschuk <max@romantschuk.fi>
Date: Tue, 11 Aug 2009 08:58:23 +0300
Message-ID: <4A81087F.1000800@romantschuk.fi>
Hi Everyone,

I've been off the list for quite some time, so bear with me if I missed 
something searching the archives.

I've been looking at the meter element, which specifically states that 
"There is no explicit way to specify units in the meter element, but the 
units may be specified in the title attribute in free-form text."

Having used the web for the past 15 years I've always felt that it's a 
shame when you run into a page with a set of measurements and those 
can't be interpreted automatically in a sensible fashion. Especially 
with the fact that there are both imperial and metric units still around 
in this day and age.

An backwards compatible inline element to specify a quantity would be 
rather trivial:

<quantity unit="cm">12 cm</quantity>
<quantity unit="kg">2 kg</quantity>

With this implementation a number inside the quantity element would be 
interpreted as the numerical value of the unit. Other characters would 
be ignored. That way old browsers would simply ignore the unknown tag, 
whereas a browser aware of this tag could provide DOM hooks for things 
like implementing a browser extension to convert between metric and 
imperial units.

Food for thought. Opinions, anyone?


        Max Romantschuk
        max at romantschuk.fi
Received on Monday, 10 August 2009 22:58:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:15 UTC