- From: Philip Jägenstedt <philipj@opera.com>
- Date: Fri, 15 Jan 2010 10:06:19 +0100
- To: "Toby Inkster" <tai@g5n.co.uk>, "public-html@w3.org" <public-html@w3.org>
On Fri, 15 Jan 2010 00:30:21 +0100, Toby Inkster <tai@g5n.co.uk> wrote: > This is a sketch of a proposal for decentralised extensibility (DE) in > HTML5. If there is interest in it, I'll be happy to write it up as a > change proposal, but I'd like to see what people think first. I like the overall goal, because it is exactly like microdata. Comments below. > The class attribute has traditionally been used mostly by authors for > their own purposes. That doesn't need to conflict with this solution, as > I will later indicate a mechanism for documents to specify which > otherspec(s) they are making use of. Overloading the class attribute (like microformats) isn't a very good idea, it *will* clash with existing markup. The world doesn't end, but it's best to avoid, and in fact easy to avoid. > So, how should one add custom attributes to otherspecs. We repurpose the > data-* attributes: > > <span class="Car" data-engine-size="1.8L" > data-colour="blue">Mazda</span> What if the original markup were <tr><td>Mazda</td><td>1.8L</td><td>blue</td></tr> or any other form where the data being marked up is visible in the page? > Currently the data-* attributes are reserved entirely for the author's > private use. In this proposal, the definition of those attributes would > be changed to allow otherspecs to assign particular meaning to data-* > attributes, but only in the case where document authors have explicitly > indicated which otherspec(s) they're making use of. I don't think this is a very good idea, as data-* are always hidden and not suitable for marking up content that is visible in the page. > So, my original XML-style <car/> element could be written as: > > <span > profile="http://example.com/CarML/html5" > class="Car" > data-engine-size="1.8L" > data-colour="blue">Mazda</span> <span itemscope itemtype="http://example.com/CarML/html5#Car"> <span hidden itemprop="engine-size">1.8L</span> <span hidden itemprop="colour">blue</span> Mazda </span> Of course your example and mine would be much better if the engine size and color were actually part of the page, e.g. <tr itemscope itemtype="http://example.com/CarML/html5#Car"> <td itemprop="manufacturer>Mazda</td> <td itemprop="engine-size">1.8L</td> <td itemprop="colour">blue</td> </tr> > An optional extra would be a DOM method > getElementsByClassNameWithProfile(classname, profileuri) which return a > collection of elements matching the provided class, but only if they > were within the scope of a particular profile URI. Microdata: document.getItems("http://example.com/CarML/html5#Car") As a side note, I'm not sure what kind of page one would find at http://example.com/CarML/html5 in your example, but what is possibly missing from microdata is some formal way of describing the vocabulary to automate validation. I think it's premature to standardize anything though, experimentation is necessary. -- Philip Jägenstedt Core Developer Opera Software
Received on Friday, 15 January 2010 09:07:05 UTC