Re: microdata: the properties of an item

On Wed, 3 Feb 2010, Philip Jägenstedt wrote:
>
> http://dev.w3.org/html5/md/#the-properties-of-an-item
> 
> The recent changes to this definition go a bit overboard in throwing 
> away properties in order to prevent itemref loops.

Yes.

I've removed the failure when an itemprop is referenced twice, as in some 
of your examples:

> <div itemscope itemref="x">
> <div id="x" itemprop="p">foo</div>
> </div>
>
> (easy to get if you rearrange your markup a bit after adding microdata)
>
> <div itemscope itemref="x x"></div>
> <div id="x" itemprop="p">foo</div>
>
> (much like duplicate class names, probably easy to get with 
> machine-generated markup)

...so those will now work.

I've also made it so that when you're looking at an item, any properties 
that reference that item again (directly or indirectly) are dropped. This 
solves problems like:

   <div itemscope itemref=x></div>
   <div id=x>
    <p itemprop=x itemscope>
     <span itemprop=x itemscope itemref=x></span>
    </p>
    <p itemprop=y></p>
   </div>

This will now generate one top-level item with one property (y), and if 
you somehow get hold of the two other elements with an itemscope and ask 
for their properties, the first one will have no properties and the second 
will have one (y).

Is this lenient enough? It seems rather arbitrary to me (you get different 
parts of the graph depending on where you start).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 6 April 2010 23:57:03 UTC