html5: Difference between revisions
(create referenceable subsections for HTML5 features, resolve profile issue) |
(→data attributes: emphasize not for microformats, remove confusing clause about microformats not for browsers, add note about private use only poshformats.) |
||
Line 30: | Line 30: | ||
=== data attributes === | === data attributes === | ||
'''<code>data-</code> naming convention for tag attributes'''. the draft specification states that any attribute that starts with "data-" will be treated as a storage area for private data. | '''<code>data-</code> naming convention for tag attributes'''. the draft specification states that any attribute that starts with "data-" will be treated as a storage area for private data. | ||
* Note that the data-* stuff is explicitly | * Note that the data-* stuff is explicitly <em>not</em> for microformats. Those attributes are defined in such a way that browsers will never do anything special with them, ever. They are intended for script authors to have a space in which they can play without ever clashing with anything the browser does. There may be some cases of private [[poshformats]] that are never intended for interchange that may be used in data-* attributes. | ||
== Current microformat compatibility == | == Current microformat compatibility == |
Revision as of 23:30, 5 November 2009
Microformats in HTML 5
This page is to document future use of microformats in HTML 5. None of the items documented are supported now, and may change upon proper development within the microformats community, or changes in the HTML 5 specification. This page is to track HTML5 enabled enhancements to microformats, and issues that HTML5 raises. It may be used to track issues which we need to push back into the HTML 5 development process.
If there are things that Microformats would like to mark up that aren't handled by HTML5 explicitly, please let the WHATWG know, so we can improve HTML5. This is how time
came to be, for instance.
New features in HTML5
time element
time
element for representing date times. In HTML5, the machine form of datetimes can be represented natively. It should be possible to replace the date-time design pattern with native HTML.
time
takes an optionalpubdate
attribute, to indicate the publication date of anarticle
. Synonymous with hAtompublished
, may imply hAtomupdated
, may imply hReviewdtreviewed
, may imply hListingdtlisted
article element
article
element for major, independent compositions of content within a page. Perhaps synonymous with hAtom hentry
. Could be parsed as hentry
within explicit hfeed
blocks?
microdata
microdata. HTML5 provides a set of attributes and associated DOM APIs for extracting data from web pages.
itemprop
attribute is a more specific version ofclass
, for field namessubject
attribute allows semantically linking within the page. Conceptually similar to the include-pattern.<itemref refid="x" />
allows semantically linking within the page. Conceptually similar to the include-pattern.content
attribute on themeta
element can be used to invisibly include data. Conceptually similar to the value-class-pattern.itemscope
attribute identifies blocks to be marked as structure data. Conceptually similar to the mfo brainstorming?itemtype
attribute to specify the type for an item (for example:itemtype="http://microformats.org/profile/hcard"
)
microdata vocabularies
- microdata vCard - use hCard instead, taking into account the hCard FAQ and resolved+closed issues. hCard 1.0.1 (under development) is incorporating these errata. Avoid the "microdata vCard" vocabulary as it is an out-of-date fork/snapshot of hCard.
- microdata vEvent - use hCalendar instead, taking into account the hCalendar FAQ and resolved+closed issues. hCalendar 1.0.1 is incorporating these errata. Avoid the "microdata vEvent" vocabulary, as it is an out-of-date fork/snapshot of hCalendar's vevent root class name and applicable properties.
- microdata Licensing Works - see also licensing-brainstorming
data attributes
data-
naming convention for tag attributes. the draft specification states that any attribute that starts with "data-" will be treated as a storage area for private data.
- Note that the data-* stuff is explicitly not for microformats. Those attributes are defined in such a way that browsers will never do anything special with them, ever. They are intended for script authors to have a space in which they can play without ever clashing with anything the browser does. There may be some cases of private poshformats that are never intended for interchange that may be used in data-* attributes.
Current microformat compatibility
There seems to be no issue with current implementation of the following microformats in HTML 5:
Requests
- "how to use with HTML5" sections that include (a) microformats examples that use HTML5, and (b) microformats parsing details that specify what to do (if anything special is required) with HTML5 elements (e.g. how to parse the
time
element for dates and times for microformats). See (and add to if necessary) :- hCard brainstorming - how to use with HTML5
- hCalendar brainstorming - how to use with HTML5 e.g. hCalendar with the
time
element - citation brainstorming - how to use with HTML5
- if nothing special is required for HTML5, then after performing the analysis, that should be noted as well, for the purpose of clarity.
Issues
- The
rev
attribute has been removed. In HTML5,rel
andrev
are no-longer paired, and therel
attribute nolonger describes the direction of a relationship. Microformats which userev
will need to userel
instead.- Or something like data-rev="vote-for"
- As above,
data-
attributes are for application-context functionality, not shared vocabularies. Further, the HTML5 specification makesrel
the correct attribute to use, regardless of direction, through the changed specification. --BenWard 17:53, 12 May 2009 (UTC)
- As above,
- Or something like data-rev="vote-for"
- The
profile
attribute has been removed. In HTML, theprofile
attribute from thehead
has been removed, with no direct replacement. This causes issues for GRDDL support. It's been suggested that profile URLs be represented inlink
elements instead, or even as a custom HTTP header. See grddl and profile-uris- See rel-profile which is the replacement for the profile attribute. Tantek 23:24, 5 November 2009 (UTC)
- Microdata
itemprop
duplicatesclass
data. the new attribute itemprop is designed to hold some meaningful data about an element, but class already exists to hold this data. Unsure of reasons why itemprop required?- This is because microdata is designed to be generically parsable, even when the parser does not understand the vocabulary. As such, property names have to be on an explicit attribute, not shared with other, non-data classnames. --BenWard 21:12, 4 September 2009 (UTC)