A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

MicrosyntaxDescriptions: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
(→‎time: is)
(→‎week: Edited spec text)
Line 95: Line 95:


==week==
==week==
(WF2)
A week consists of a year and a week number encoded according to ISO 8601: four or more digits (<code>0</code>–<code>9</code>) representing the year, a hyphen (<code>-</code>), a literal <code>W</code>, and two digits for the week, zero-padded if necessary. The week number must be a number greater than or equal to <code>01</code>. Week <code>01</code> of a given year is the week containing the 4<sup>th</sup> of January; weeks start on Monday. For instance: <code>2005-W52</code> is the week that ended on Sunday the first of January, 2006.

Revision as of 22:31, 21 November 2007

The purpose of this page is to enable collaborative creation of brief advisory text for each HTML5 microsyntax so that when an attribute value does not conform to a given microsyntax, a validator can display the advisory text about the syntax to guide the author to fix the value. Note that like the rest of this wiki, editing requires you to agree to release your contributions under the MIT license (see wiki footer). Please note that while copying text from the WHATWG version of HTML 5 is OK, copying text from RFCs or W3C specs is not OK.

Note that some formats pertain to Web Forms 2.0 (e.g. datetime-local).

Please keep descriptions short: one paragraph in length.

browsing-context

A browsing context name is any string that does not start with an underscore (_), or, a string that case-insensitively matches one of: _self, _parent, or _top.

charset-list

(form accept-charset value)

circle

...

date

(WF2)

date-or-time

(time element attribute version)

date-or-time-content

(time element text content version)

datetime

(WF2)

datetime-local

(WF2)

datetime-tz

(ins/del)

email

An e-mail address must match the addr-spec production defined in RFC 2822 section 3.4.1 excluding the CFWS production everywhere and excluding the FWS production everywhere except in the quoted-string production.

float

...

float-non-negative

...

float-positive

...

float-exp

(WF2 float)

float-exp-positive

(positive WF2 float)

hashed-id-ref

...

ID

An ID consists of at least one character but must not contain any whitespace.

integer

One or more digits (09) without a period (.), optionally preceded by a hyphen (-). For example: 42 and -273 are valid, but +42 is not.

integer-non-negative

One or more digits (09) without a period (.). For example: 42 and 0 are valid, but -273 is not.

integer-positive

One or more digits (09), with at least one which is non-zero, and without a period (.). For example: 42 is valid, but 00 is not.

iri

An absolute URL. For example: http://example.org/hello, but not /hello.

iri-ref

Any URL. For example: /hello, #canvas, or http://example.org/.

language

An RFC 4646 language tag consists of hyphen-separated ASCII-alphanumeric subtags. There is a primary tag identifying a natural language by its shortest ISO 639 language code (e.g. en for English) and zero or more additional subtags adding precision. The most common additional subtag type is a region subtag which most commonly is a two-letter ISO 3166 country code (e.g. GB for the United Kingdom). IANA maintains a registry of permissible subtags.

media-query

...

mime-type

(RFC2616 version)

mime-type-list

(WF2)

month

(WF2)

pattern

(WF2)

polyline

...

ratio

(progress content)

rectangle

...

time

A time (hour, minute, seconds, fractional seconds) is encoded according to ISO 8601 with no time zone: two digits (09) for the hour, a colon, two digits for the minute, optionally a colon and two digits for the second, and optionally (if the seconds are present) a period (.) and one or more digits for the fraction of a second. All the numbers must be in base ten and zero-padded if necessary. For instance: 23:59:00.00000 or 00:00:05.

week

A week consists of a year and a week number encoded according to ISO 8601: four or more digits (09) representing the year, a hyphen (-), a literal W, and two digits for the week, zero-padded if necessary. The week number must be a number greater than or equal to 01. Week 01 of a given year is the week containing the 4th of January; weeks start on Monday. For instance: 2005-W52 is the week that ended on Sunday the first of January, 2006.