[whatwg] Microdata feedback

On Sat, 09 Jul 2011 01:19:02 +0200, Ian Hickson <ian at hixie.ch> wrote:

> On Sat, 9 Jul 2011, Philip J?genstedt wrote:
>>
>> Step 11 is "If current has an itemprop attribute specified, add it to
>> results." but should be "If current has one or more property names, add
>> it to results." Property names are defined in
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#property-names
>>
>> Why? If you start with <div itemprop="foo">, then
>> div.itemProp.remove("foo") would give you <div itemprop="">. It'd be
>> weird if the element still showed up in the properties collection after
>> removing the only property name.
>
> The .properties attribute "must return an HTMLPropertiesCollection rooted
> at the Document node, whose filter matches only elements that have
> property names", which further filters the results of the algorithm.
> Similarly, everything that uses the algorithm here does things "for each
> property name", so if itemprop="" doesn't have any tokens, nothing  
> happens
> and it doesn't matter that the algorithm returns it.

Ah, I see my misunderstanding.

Purely editorial: It would, IMO, be more clear if that check were in the  
algorithm itself. That's the way it's going to be (has been) implemented  
since there's no reason to do the filtering as a separate step. Do as you  
wish.

-- 
Philip J?genstedt
Core Developer
Opera Software

Received on Friday, 8 July 2011 23:41:39 UTC