[whatwg] Microdata feedback
ian at hixie.ch
Thu Dec 8 13:04:41 PST 2011
On Sat, 9 Jul 2011, Philip Jägenstedt wrote:
> 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.
I changed the spec as you suggest. I agree that it's cleaner. I checked
and I don't think it'll have any negative side-effects, though it does
change the precise number of conformance errors in some invalid documents
(not a truly practical concern since conformance checkers are only
required to report zero errors if there are none and at least one error if
there are any).
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg