This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14586 - Microdata: inconsistency between itemType, getItems and JSON regarding absolute URLs
Summary: Microdata: inconsistency between itemType, getItems and JSON regarding absolu...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-28 15:09 UTC by contributor
Modified: 2012-07-18 18:46 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2011-10-28 15:09:30 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
Multipage: http://www.whatwg.org/C#microdata-dom-api
Complete: http://www.whatwg.org/c#microdata-dom-api

Comment:
Microdata: inconsistency between itemType, getItems and JSON regarding
absolute URLs

Posted from: 83.218.67.122 by philipj@opera.com
User agent: Opera/9.80 (X11; Linux x86_64; U; Edition Next; en) Presto/2.9.220 Version/12.00
Comment 1 Philip J├Ągenstedt 2011-10-28 15:19:14 UTC
itemType is a plain DOMSettableTokenList, so any tokens are visible, even those that are not absolute URLs.

The definition of getItems seems contradictory, talking about "top-level microdata items whose _types_ include all the types specified in the method's argument, having obtained the types by splitting the string on spaces." _types_ is xref'd to [1] which talks about "the absolute URLs obtained by splitting the element's itemtype attribute's value on spaces". Are the types obtained by simply "splitting the string on spaces" or are they restricted to absolute URLs? The note makes it clear that the latter is intended, so "having obtained the types by splitting the string on spaces" must be left-overs from the last spec change.

The JSON export algorithm also refers to [1], such that only absolute URLs would be included.

It is inconsistent to expose all tokens in itemType but only valid ones via getItems() and JSON. Actually checking that the token is an absolute URL is a bit annoying when implementing (I'm trying to update Live Microdata), so I would prefer that both getItems and the JSON export just treat the tokens as opaque strings and not care that they are URLs.

Finally, by having the API filter the types, it'll be more painful if we ever want to allow non-URL item types, such as private-use itemtype="foo" or reverse DNS itemtype="com.example.Thing".

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#item-types
Comment 2 Ian 'Hixie' Hickson 2011-11-01 05:56:05 UTC
Ok, I'll remove the absolute URL filtering.
Comment 3 contributor 2011-11-01 16:31:54 UTC
Checked in as WHATWG revision r6807.
Check-in comment: Remove the requirement that UAs check that item types are syntactically correct after splitting the itemtype='' attribute.
http://html5.org/tools/web-apps-tracker?from=6806&to=6807
Comment 4 Philip J├Ągenstedt 2011-11-01 21:27:39 UTC
You left this note in http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#json

"Note: Since only absolute URLs can be item types, any tokens in the itemtype attribute that are not absolute URLs are dropped."
Comment 5 Ian 'Hixie' Hickson 2011-11-02 17:01:43 UTC
Oops. Fixed.
Comment 6 contributor 2011-11-02 17:02:39 UTC
Checked in as WHATWG revision r6813.
Check-in comment: Forgot to remove this now false note
http://html5.org/tools/web-apps-tracker?from=6812&to=6813