Re: Microdata: The Itemref element

On Sun, 18 Oct 2009, Nicholas Stimpson wrote:
> 
> Clearly, for many web pages this may require different CSS selectors and 
> scripting to handle both cases, and it is likely to be a major source of 
> bugs and confusion.

You can sidestep some of the problems using <span><itemref></span>, or 
just by making sure <itemref> is the last element in its container.

Generally though, <itemref> is rarely going to be used, so I don't think 
it's a big deal.


> Instead, would it be possible for the element with the "itemscope" 
> attribute to have an itemref attribute that was a space separated list 
> of ids?

It'd certainly be possible, but I'm not sure it's desireable, given how 
easy it is to work around.


> If none of the above is practical, then could the draft contain advice 
> to place itemref elements at the end of the itemscope div like this?
> 
> <div itemscope>
> <p itemprop="b">test</p>
> <p itemprop="a">2</p>
> <itemref refid="x">
> </div>
> <div id="x">
> <p itemprop="a">1</p>
> </div>
> 
> Although the DOMs will still be different if there's more than itemref 
> element, the effect on css selectors and scripting will be minimised.

This is good advice to have in tutorials today, but I don't think it makes 
sense to have this in the spec (which will last years).

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

Received on Sunday, 18 October 2009 21:47:10 UTC