[html5] r3718 - [] (0) Move pubdate='' from <article> to <time>.
whatwg at whatwg.org
whatwg at whatwg.org
Mon Aug 31 00:48:54 PDT 2009
Author: ianh
Date: 2009-08-31 00:48:53 -0700 (Mon, 31 Aug 2009)
New Revision: 3718
Modified:
index
source
Log:
[] (0) Move pubdate='' from <article> to <time>.
Modified: index
===================================================================
--- index 2009-08-31 05:53:43 UTC (rev 3717)
+++ index 2009-08-31 07:48:53 UTC (rev 3718)
@@ -3772,6 +3772,12 @@
<div class=impl>
+ <p>The <dfn id=best-representation-of-the-global-date-and-time-string>best representation of the global date and time
+ string</dfn> <var title="">datetime</var> is the <a href=#valid-global-date-and-time-string>valid global
+ date and time string</a> representing <var title="">datetime</var> with the last character of the string not
+ being a U+005A LATIN CAPITAL LETTER Z character, even if the
+ time zone is UTC.</p>
+
<p>The rules to <dfn id=parse-a-global-date-and-time-string>parse a global date and time string</dfn> are
as follows. This will either return a time in UTC, with associated
time-zone offset information for round tripping or display purposes,
@@ -3975,8 +3981,6 @@
<h5 id=vaguer-moments-in-time><span class=secno>2.4.5.7 </span>Vaguer moments in time</h5>
- <p>A <dfn id=date-or-time-string>date or time string</dfn> consists of either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, or a <a href=#concept-datetime title=concept-datetime>global date and time</a>.</p>
-
<p>A string is a <dfn id=valid-date-or-time-string>valid date or time string</dfn> if it is also
one of the following:</p>
@@ -3991,9 +3995,22 @@
followed by a <a href=#valid-date-or-time-string>valid date or time string</a>, followed by
zero or more further <a href=#white_space>White_Space</a> characters.</p>
+ <hr><p>A string is a <dfn id=valid-date-string-with-optional-time>valid date string with optional time</dfn> if
+ it is also one of the following:</p>
+
+ <ul><li>A <a href=#valid-date-string>valid date string</a>.</li>
+
+ <li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li>
+
+ </ul><p>A string is a <dfn id=valid-date-string-in-content-with-optional-time>valid date string in content with optional
+ time</dfn> if it consists of zero or more <a href=#white_space>White_Space</a>
+ characters, followed by a <a href=#valid-date-string-with-optional-time>valid date string with optional
+ time</a>, followed by zero or more further
+ <a href=#white_space>White_Space</a> characters.</p>
+
<div class=impl>
- <p>The rules to <dfn id=parse-a-date-or-time-string>parse a date or time string</dfn> are as
+ <hr><p>The rules to <dfn id=parse-a-date-or-time-string>parse a date or time string</dfn> are as
follows. The algorithm is invoked with a flag indicating if the
<i>in attribute</i> variant or the <i>in content</i> variant is to
be used. The algorithm will either return a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If
@@ -12700,13 +12717,8 @@
<dd><a href=#flow-content>Flow content</a>.</dd>
<dt>Content attributes:</dt>
<dd><a href=#global-attributes>Global attributes</a></dd>
- <dd><code title=attr-article-pubdate><a href=#attr-article-pubdate>pubdate</a></code></dd>
<dt>DOM interface:</dt>
- <dd>
-<pre class=idl>interface <dfn id=htmlarticleelement>HTMLArticleElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
- attribute DOMString <a href=#dom-article-pubdate title=dom-article-pubDate>pubDate</a>;
-};</pre>
- </dd>
+ <dd>Uses <code><a href=#htmlelement>HTMLElement</a></code>.</dd>
</dl><p>The <code><a href=#the-article-element>article</a></code> element <a href=#represents>represents</a> a
section of a page that consists of a composition that forms an
independent part of a document, page, application, or site. This
@@ -12731,20 +12743,8 @@
element (q.v. the <code><a href=#the-address-element>address</a></code> element) does not apply to
nested <code><a href=#the-article-element>article</a></code> elements.</p>
- <p>The <dfn id=attr-article-pubdate title=attr-article-pubdate><code>pubdate</code></dfn>
- attribute may be used to specify the time and date that the article
- was first published. If present, the <code title=attr-article-pubdate><a href=#attr-article-pubdate>pubdate</a></code> attribute must be a
- <a href=#valid-global-date-and-time-string>valid global date and time string</a> value.</p>
- <div class=impl>
- <p>The <dfn id=dom-article-pubdate title=dom-article-pubDate><code>pubDate</code></dfn>
- IDL attribute must <a href=#reflect>reflect</a> the element's <code title=attr-article-pubdate><a href=#attr-article-pubdate>pubdate</a></code> content attribute.</p>
-
- </div>
-
-
-
<h4 id=the-aside-element><span class=secno>4.4.5 </span>The <dfn><code>aside</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
@@ -15390,10 +15390,12 @@
<dt>Content attributes:</dt>
<dd><a href=#global-attributes>Global attributes</a></dd>
<dd><code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code></dd>
+ <dd><code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute DOMString <a href=#dom-time-datetime title=dom-time-datetime>dateTime</a>;
+ attribute boolean <a href=#dom-time-pubdate title=dom-time-pubDate>pubDate</a>;
readonly attribute <span>Date</span> <a href=#dom-time-date title=dom-time-date>date</a>;
readonly attribute <span>Date</span> <a href=#dom-time-time title=dom-time-time>time</a>;
readonly attribute <span>Date</span> <a href=#dom-time-timezone title=dom-time-timezone>timezone</a>;
@@ -15431,22 +15433,51 @@
</div>
+ <p>The <dfn id=attr-time-pubdate title=attr-time-pubdate><code>pubdate</code></dfn>
+ attribute is a <a href=#boolean-attribute>boolean attribute</a>. If specified, it
+ indicates that the date and time given by the element is the
+ publication date and time of the nearest ancestor
+ <code><a href=#the-article-element>article</a></code> element. If the element has no ancestor
+ <code><a href=#the-article-element>article</a></code> element, the <code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code> attribute must not be
+ specified. If the element has an ancestor <code><a href=#the-article-element>article</a></code>
+ element and the <code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code>
+ attribute is specified, then the element <i>needs a date</i>. For
+ each <code><a href=#the-article-element>article</a></code> element, there must no more than one
+ <code><a href=#the-time-element>time</a></code> element with a <code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code> attribute whose nearest
+ ancestor is that <code><a href=#the-article-element>article</a></code> element.</p>
+
<p>The <dfn id=attr-time-datetime title=attr-time-datetime><code>datetime</code></dfn>
- attribute, if present, must contain a <a href=#valid-date-or-time-string>valid date or time
- string</a> that identifies the date or time being specified.</p>
+ attribute, if present, gives the date or time being
+ specified. Otherwise, the date or time is given by the element's
+ contents.</p>
- <p>If the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute
- is not present, then the date or time must be specified in the
- content of the element, such that the element's
- <code>textContent</code> is a <a href=#valid-date-or-time-string-in-content>valid date or time string in
- content</a>, and the date, if any, must be expressed using the
- Gregorian calendar.</p>
+ <p>If the element <i>needs a date</i>, and the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is present,
+ then the attribute's value must be a <a href=#valid-date-string-with-optional-time>valid date string with
+ optional time</a>.</p>
+ <p>If the element <i>needs a date</i>, but the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is not present,
+ then the element's <code>textContent</code> must be a <a href=#valid-date-string-in-content-with-optional-time>valid
+ date string in content with optional time</a>.</p>
+
+ <p>If the element does not <i>need a date</i>, and the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is present,
+ then the attribute's value must be a <a href=#valid-date-or-time-string>valid date or time
+ string</a>.</p>
+
+ <p>If the element does not <i>need a date</i>, but the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is not present,
+ then the element's <code>textContent</code> must be a <a href=#valid-date-or-time-string-in-content>valid
+ date or time string in content</a>.</p>
+
+ <p>The date, if any, must be expressed using the Gregorian
+ calendar.</p>
+
+ <div class=impl>
+
<p>If the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute
- is present, then the element may be empty, in which case the user
- agent should convey the attribute's value to the user when rendering
- the element.</p>
+ is present, the user agent should convey the attribute's value to
+ the user when rendering the element.</p>
+ </div>
+
<div class=example>
<p>The <code><a href=#the-time-element>time</a></code> element can be used to encode dates, for
@@ -15491,6 +15522,9 @@
<p>The <dfn id=dom-time-datetime title=dom-time-datetime><code>dateTime</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute.</p>
+ <p>The <dfn id=dom-time-pubdate title=dom-time-pubDate><code>pubDate</code></dfn> IDL
+ attribute must <a href=#reflect>reflect</a> the <code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code> content attribute.</p>
+
<p>User agents, to obtain the <dfn id=concept-time-date title=concept-time-date>date</dfn>, <dfn id=concept-time-time title=concept-time-time>time</dfn>, and <dfn id=concept-time-timezone title=concept-time-timezone>time-zone offset</dfn> represented by
a <code><a href=#the-time-element>time</a></code> element, must follow these steps:</p>
@@ -15610,8 +15644,39 @@
</div>
+ <div class=example>
+ <p>In this example, an article's publication date is marked up
+ using <code><a href=#the-time-element>time</a></code>:</p>
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate>2009-08-30</time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ <p>Here is another way that could be marked up:</p>
+
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate datetime="2009-08-30">today</time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ <p>Here is the same thing but with the time included. Because the
+ element is empty, it will be replaced in the rendering with a
+ more readable version of the date and time given.</p>
+
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate datetime="2009-08-30T07:13Z">lt;/time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ </div>
+
+
+
<h4 id=the-code-element><span class=secno>4.6.10 </span>The <dfn><code>code</code></dfn> element</h4>
<dl class=element><dt>Categories</dt>
@@ -46104,12 +46169,26 @@
<li>
- <p>If <var title="">article</var> has a <code title=attr-article-pubdate><a href=#attr-article-pubdate>pubdate</a></code> attribute, and <a href=#parse-a-global-date-and-time-string title="parse a global date and time string">parsing that
- attribute's value as a global date and time string</a> does
- not result in an error, then let <var title="">publication
- date</var> be the value of that attribute.</p>
+ <p>If <var title="">article</var> has a <code><a href=#the-time-element>time</a></code>
+ element descendant that has a <code title=attr-time-pubdate><a href=#attr-time-pubdate>pubdate</a></code> attribute and whose
+ nearest ancestor <code><a href=#the-article-element>article</a></code> element is <var title="">article</var>, and the first such element's <a href=#concept-time-date title=concept-time-date>date</a> is not unknown, then run
+ the following substeps, with <var title="">e</var> being the
+ first such element:</p>
- <p>Otherwise, let <var title="">publication date</var> have no
+ <ol><li><p>Let <var title="">datetime</var> be a <a href=#concept-datetime title=concept-datetime>global date and time</a> whose date
+ component is the <a href=#concept-time-date title=concept-time-date>date</a> of
+ <var title="">e</var>.</li>
+
+ <li><p>If <var title="">e</var>'s <a href=#concept-time-time title=concept-time-time>time</a> and <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a> are not
+ unknown, then let <var title="">datetime</var>'s time and
+ time-zone offset components be the <a href=#concept-time-time title=concept-time-time>time</a> and <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a> of <var title="">e</var>. Otherwise, let them be midnight and no offset
+ respectively ("<code title="">00:00Z</code>").</li>
+
+ <li><p>Let <var title="">publication date</var> be the
+ <a href=#best-representation-of-the-global-date-and-time-string>best representation of the global date and time
+ string</a> <var title="">datetime</var>.</li>
+
+ </ol><p>Otherwise, let <var title="">publication date</var> have no
value.</p>
</li>
Modified: source
===================================================================
--- source 2009-08-31 05:53:43 UTC (rev 3717)
+++ source 2009-08-31 07:48:53 UTC (rev 3718)
@@ -3191,6 +3191,13 @@
<div class="impl">
+ <p>The <dfn>best representation of the global date and time
+ string</dfn> <var title="">datetime</var> is the <span>valid global
+ date and time string</span> representing <var
+ title="">datetime</var> with the last character of the string not
+ being a U+005A LATIN CAPITAL LETTER Z character, even if the
+ time zone is UTC.</p>
+
<p>The rules to <dfn>parse a global date and time string</dfn> are
as follows. This will either return a time in UTC, with associated
time-zone offset information for round tripping or display purposes,
@@ -3459,11 +3466,6 @@
<h5>Vaguer moments in time</h5>
- <p>A <dfn>date or time string</dfn> consists of either a <span
- title="concept-date">date</span>, a <span
- title="concept-time">time</span>, or a <span
- title="concept-datetime">global date and time</span>.</p>
-
<p>A string is a <dfn>valid date or time string</dfn> if it is also
one of the following:</p>
@@ -3482,8 +3484,29 @@
followed by a <span>valid date or time string</span>, followed by
zero or more further <span>White_Space</span> characters.</p>
+ <hr>
+
+ <p>A string is a <dfn>valid date string with optional time</dfn> if
+ it is also one of the following:</p>
+
+ <ul>
+
+ <li>A <span>valid date string</span>.</li>
+
+ <li>A <span>valid global date and time string</span>.</li>
+
+ </ul>
+
+ <p>A string is a <dfn>valid date string in content with optional
+ time</dfn> if it consists of zero or more <span>White_Space</span>
+ characters, followed by a <span>valid date string with optional
+ time</span>, followed by zero or more further
+ <span>White_Space</span> characters.</p>
+
<div class="impl">
+ <hr>
+
<p>The rules to <dfn>parse a date or time string</dfn> are as
follows. The algorithm is invoked with a flag indicating if the
<i>in attribute</i> variant or the <i>in content</i> variant is to
@@ -13564,13 +13587,8 @@
<dd><span>Flow content</span>.</dd>
<dt>Content attributes:</dt>
<dd><span>Global attributes</span></dd>
- <dd><code title="attr-article-pubdate">pubdate</code></dd>
<dt>DOM interface:</dt>
- <dd>
-<pre class="idl">interface <dfn>HTMLArticleElement</dfn> : <span>HTMLElement</span> {
- attribute DOMString <span title="dom-article-pubDate">pubDate</span>;
-};</pre>
- </dd>
+ <dd>Uses <code>HTMLElement</code>.</dd>
</dl>
<p>The <code>article</code> element <span>represents</span> a
@@ -13597,22 +13615,8 @@
element (q.v. the <code>address</code> element) does not apply to
nested <code>article</code> elements.</p>
- <p>The <dfn title="attr-article-pubdate"><code>pubdate</code></dfn>
- attribute may be used to specify the time and date that the article
- was first published. If present, the <code
- title="attr-article-pubdate">pubdate</code> attribute must be a
- <span>valid global date and time string</span> value.</p>
- <div class="impl">
- <p>The <dfn title="dom-article-pubDate"><code>pubDate</code></dfn>
- IDL attribute must <span>reflect</span> the element's <code
- title="attr-article-pubdate">pubdate</code> content attribute.</p>
-
- </div>
-
-
-
<h4>The <dfn><code>aside</code></dfn> element</h4>
<dl class="element">
@@ -16480,10 +16484,12 @@
<dt>Content attributes:</dt>
<dd><span>Global attributes</span></dd>
<dd><code title="attr-time-datetime">datetime</code></dd>
+ <dd><code title="attr-time-pubdate">pubdate</code></dd>
<dt>DOM interface:</dt>
<dd>
<pre class="idl">interface <dfn>HTMLTimeElement</dfn> : <span>HTMLElement</span> {
attribute DOMString <span title="dom-time-datetime">dateTime</span>;
+ attribute boolean <span title="dom-time-pubDate">pubDate</span>;
readonly attribute <span>Date</span> <span title="dom-time-date">date</span>;
readonly attribute <span>Date</span> <span title="dom-time-time">time</span>;
readonly attribute <span>Date</span> <span title="dom-time-timezone">timezone</span>;
@@ -16523,22 +16529,57 @@
</div>
+ <p>The <dfn title="attr-time-pubdate"><code>pubdate</code></dfn>
+ attribute is a <span>boolean attribute</span>. If specified, it
+ indicates that the date and time given by the element is the
+ publication date and time of the nearest ancestor
+ <code>article</code> element. If the element has no ancestor
+ <code>article</code> element, the <code
+ title="attr-time-pubdate">pubdate</code> attribute must not be
+ specified. If the element has an ancestor <code>article</code>
+ element and the <code title="attr-time-pubdate">pubdate</code>
+ attribute is specified, then the element <i>needs a date</i>. For
+ each <code>article</code> element, there must no more than one
+ <code>time</code> element with a <code
+ title="attr-time-pubdate">pubdate</code> attribute whose nearest
+ ancestor is that <code>article</code> element.</p>
+
<p>The <dfn title="attr-time-datetime"><code>datetime</code></dfn>
- attribute, if present, must contain a <span>valid date or time
- string</span> that identifies the date or time being specified.</p>
+ attribute, if present, gives the date or time being
+ specified. Otherwise, the date or time is given by the element's
+ contents.</p>
- <p>If the <code title="attr-time-datetime">datetime</code> attribute
- is not present, then the date or time must be specified in the
- content of the element, such that the element's
- <code>textContent</code> is a <span>valid date or time string in
- content</span>, and the date, if any, must be expressed using the
- Gregorian calendar.</p>
+ <p>If the element <i>needs a date</i>, and the <code
+ title="attr-time-datetime">datetime</code> attribute is present,
+ then the attribute's value must be a <span>valid date string with
+ optional time</span>.</p>
+ <p>If the element <i>needs a date</i>, but the <code
+ title="attr-time-datetime">datetime</code> attribute is not present,
+ then the element's <code>textContent</code> must be a <span>valid
+ date string in content with optional time</span>.</p>
+
+ <p>If the element does not <i>need a date</i>, and the <code
+ title="attr-time-datetime">datetime</code> attribute is present,
+ then the attribute's value must be a <span>valid date or time
+ string</span>.</p>
+
+ <p>If the element does not <i>need a date</i>, but the <code
+ title="attr-time-datetime">datetime</code> attribute is not present,
+ then the element's <code>textContent</code> must be a <span>valid
+ date or time string in content</span>.</p>
+
+ <p>The date, if any, must be expressed using the Gregorian
+ calendar.</p>
+
+ <div class="impl">
+
<p>If the <code title="attr-time-datetime">datetime</code> attribute
- is present, then the element may be empty, in which case the user
- agent should convey the attribute's value to the user when rendering
- the element.</p>
+ is present, the user agent should convey the attribute's value to
+ the user when rendering the element.</p>
+ </div>
+
<div class="example">
<p>The <code>time</code> element can be used to encode dates, for
@@ -16584,6 +16625,10 @@
attribute must <span>reflect</span> the <code
title="attr-time-datetime">datetime</code> content attribute.</p>
+ <p>The <dfn title="dom-time-pubDate"><code>pubDate</code></dfn> IDL
+ attribute must <span>reflect</span> the <code
+ title="attr-time-pubdate">pubdate</code> content attribute.</p>
+
<p>User agents, to obtain the <dfn
title="concept-time-date">date</dfn>, <dfn
title="concept-time-time">time</dfn>, and <dfn
@@ -16728,8 +16773,39 @@
</div>
+ <div class="example">
+ <p>In this example, an article's publication date is marked up
+ using <code>time</code>:</p>
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate>2009-08-30</time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ <p>Here is another way that could be marked up:</p>
+
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate datetime="2009-08-30">today</time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ <p>Here is the same thing but with the time included. Because the
+ element is empty, it will be replaced in the rendering with a
+ more readable version of the date and time given.</p>
+
+ <pre><article>
+ <h1>Small tasks</h1>
+ <footer>Published <time pubdate datetime="2009-08-30T07:13Z">lt;/time>.</footer>
+ <p>I put a bike bell on his bike.</p>
+</article></pre>
+
+ </div>
+
+
+
<h4>The <dfn><code>code</code></dfn> element</h4>
<dl class="element">
@@ -52128,13 +52204,38 @@
<li>
- <p>If <var title="">article</var> has a <code
- title="attr-article-pubdate">pubdate</code> attribute, and <span
- title="parse a global date and time string">parsing that
- attribute's value as a global date and time string</span> does
- not result in an error, then let <var title="">publication
- date</var> be the value of that attribute.</p>
+ <p>If <var title="">article</var> has a <code>time</code>
+ element descendant that has a <code
+ title="attr-time-pubdate">pubdate</code> attribute and whose
+ nearest ancestor <code>article</code> element is <var
+ title="">article</var>, and the first such element's <span
+ title="concept-time-date">date</span> is not unknown, then run
+ the following substeps, with <var title="">e</var> being the
+ first such element:</p>
+ <ol>
+
+ <li><p>Let <var title="">datetime</var> be a <span
+ title="concept-datetime">global date and time</span> whose date
+ component is the <span title="concept-time-date">date</span> of
+ <var title="">e</var>.</p></li>
+
+ <li><p>If <var title="">e</var>'s <span
+ title="concept-time-time">time</span> and <span
+ title="concept-time-timezone">time-zone offset</span> are not
+ unknown, then let <var title="">datetime</var>'s time and
+ time-zone offset components be the <span
+ title="concept-time-time">time</span> and <span
+ title="concept-time-timezone">time-zone offset</span> of <var
+ title="">e</var>. Otherwise, let them be midnight and no offset
+ respectively ("<code title="">00:00Z</code>").</p></li>
+
+ <li><p>Let <var title="">publication date</var> be the
+ <span>best representation of the global date and time
+ string</span> <var title="">datetime</var>.</p></li>
+
+ </ol>
+
<p>Otherwise, let <var title="">publication date</var> have no
value.</p>
More information about the Commit-Watchers
mailing list