Skip to content
Permalink
Browse files
[] (0) Move pubdate='' from <article> to <time>.
git-svn-id: http://svn.whatwg.org/webapps@3718 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 31, 2009
1 parent c51b30e commit aeed8c2ba559b0bb22f894f7ab061c30959c7e9a
Showing with 259 additions and 79 deletions.
  1. +116 −37 index
  2. +143 −42 source
153 index
@@ -3772,6 +3772,12 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<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 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<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 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
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 @@ not-slash = %x0000-002E / %x0030-10FFFF
<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,18 +12743,6 @@ not-slash = %x0000-002E / %x0030-10FFFF
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>
@@ -15390,10 +15390,12 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
<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,21 +15433,50 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the

</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>

@@ -15491,6 +15522,9 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
<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,6 +15644,37 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the

</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>&lt;article&gt;
&lt;h1&gt;Small tasks&lt;/h1&gt;
&lt;footer&gt;Published &lt;time pubdate&gt;2009-08-30&lt;/time&gt;.&lt;/footer&gt;
&lt;p&gt;I put a bike bell on his bike.&lt;/p&gt;
&lt;/article&gt;</pre>

<p>Here is another way that could be marked up:</p>

<pre>&lt;article&gt;
&lt;h1&gt;Small tasks&lt;/h1&gt;
&lt;footer&gt;Published &lt;time pubdate datetime="2009-08-30"&gt;today&lt;/time&gt;.&lt;/footer&gt;
&lt;p&gt;I put a bike bell on his bike.&lt;/p&gt;
&lt;/article&gt;</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>&lt;article&gt;
&lt;h1&gt;Small tasks&lt;/h1&gt;
&lt;footer&gt;Published &lt;time pubdate datetime="2009-08-30T07:13Z"&gt;lt;/time&gt;.&lt;/footer&gt;
&lt;p&gt;I put a bike bell on his bike.&lt;/p&gt;
&lt;/article&gt;</pre>

</div>



<h4 id=the-code-element><span class=secno>4.6.10 </span>The <dfn><code>code</code></dfn> element</h4>
@@ -46104,12 +46169,26 @@ document.body.appendChild(outer);</pre>

<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>

<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>

<p>Otherwise, let <var title="">publication date</var> have no
</ol><p>Otherwise, let <var title="">publication date</var> have no
value.</p>

</li>

0 comments on commit aeed8c2

Please sign in to comment.